Beginners - April 2018

No Matching Function for call?
 
Hi, I'm writing a number analysis program for a course. The program reads integers from a text file, then stores them in an array. A requirement of the assignm...
[12 replies] Last: Hello ayleeta, Very good and much better. Watch your indenting and s... (by Handy Andy)
by Thesar
Iostream, conversation and exceptions (1,2)
 
Hi everybody. I am writing a program that will take in values through inFile, all these values will be read as strings and converted to doubles. The range is 0....
[21 replies] Last: Hello Thesar, You are welcome. Wish I did, but I line in the US. An... (by Handy Andy)
ceiling floor and round as const int - Need Help
 
I am very new to programming and was given a HW assignment in which I am to use ceil(), floor(), and round() functions for a real number (4.78). I understand ho...
[2 replies] Last: it's for ease of use with constructs like switch statements, which a... (by icy1)
std vs cout:
 
#include <iostream> #include <string> using namespace std; int main() { std::string ends = "*****\n"; std::string mids = "* *\n"; s...
[1 reply] : std::string ends = "*****\n"; std::string mids = "* *\n"; creates... (by sciman777)
Implement Mathematical Function
 
Write a C++ program to implement/compute the following mathematical function f(x) for a positive integer x: 1/2 + 2/3 + 3/4 + .... x/x+1 Help.
[8 replies] Last: #include <iostream> using namespace std; double series( unsigned x )... (by lastchance)
g++ compiler error help, Matrix multiplication
 
Hello, I am in need of some help on getting rid of these errors im getting. I am not sure how to fix them. Also not sure how to open a file and send it to m...
[8 replies] Last: thank you for all the replies, and i am not allowed to use Vectors yet... (by sr2cute702)
Can't get getline() to work
 
When I put breakpoints to watch it, it skips right over the line where it should read getline(cin, sentence). why is it doing this and how can I fix it? It goes...
[1 reply] : When I tried using cin>> it worked but I need to read a full sentence.... (by mrphilipp7)
The difference between pointers and asterisk pointers?
 
We've been studying pointers the last few days, and I'm having difficulty understanding the differences between pointers with an asterisk and ones without. I kn...
[1 reply] : First thing's first: A pointer is simply an address in memory . Tha... (by Ganado)
............
 
.././././
[2 replies] Last: /././././. (by garza07)
Assistance With Classes (This is to help understand for my Studies - applies to homework)
 
I am an adult, very new to programming, and working on a C++ course. We have been growing our assignment from Week 1, where the code we have written continues t...
[3 replies] Last: @Gr8Tortuga, classes, conceptually, are for packaging pertinent data t... (by icy1)
What is the difference between 100 and 0100 in binary?
 
I convert 4=100 in binary but converter converts 4=0100. In shifting, 4>>2=1. So, coverter is right, 4=0100. Because 100>>2=000 but 0100>>2=0001. Where am I doi...
[3 replies] Last: Just to be explicit, there is no difference between 100 and 0100 in bi... (by MikeyBoy)
Recursive Function Problem
 
Hi,I can't understand this code. For f(4), prints 4 4 7 4 11 4 7 4 4. For f(3), prints 4 7 4. Why program prints like this? int f(int x) { if (x == 0) retur...
[2 replies] Last: Might be better off storing it all in one structure and only print onc... (by icy1)
by voro
Getline While loop not working properly
 
It should be a simple code to get all lines from a CSV file and output them on the screen, but somehow it isn't working properly. #include <iostream> #in...
[2 replies] Last: Hello voro, As lastchance said the semi-colon at the end of 18 only d... (by Handy Andy)
Taking scores from text file to create averages
 
Write your question here. Hi, making a quiz with 5 sections, 10 questions in each sections. There is a class made which takes a text file with questions and ...
[2 replies] Last: Hello sam1222, After reviewing your code I found: <conio.h> This hea... (by Handy Andy)
infix to postfix output problem
 
i reviewed my code couple of times and still could not point out why is not showing any output at all. can anyone point me where im having it wrong. #in...
[6 replies] Last: @newguy17, I'd avoid doing cin stuff for now. Just have a bunch of ha... (by icy1)
Function not declared in scope
 
im getting an error saying prepend was not declared in the scope. #include <iostream> #include <cstring> // for getline #include <cstdlib> // fo...
[3 replies] Last: im getting an error saying prepend was not declared in the scope. Ha... (by Enoizat)
Baby name rank
 
Hello. Writing program to read file and display rank of an entered name. It must display the ranking on the boy list & girl list. Only problem I'm having is whe...
[6 replies] Last: 1) I think your displayRank() function doesn’t need to return anythi... (by Enoizat)
Closed and Open Intervals
 
Hello Hello ! Haw should I write with "for" this: Closed and Open invervals: -> (a,b) -> [a,b] -> (a,b] -> (b,a] Note 1: a, b --> a...
[2 replies] Last: thank you. !!!!!!!!! (by WalterCC)
by nearc
How to create file
 
Hello, I need to created text file with 100,000 reverse sorted out elements. I generated my random 100,000 elements from website, how do I get the reverse sort...
[1 reply] : #include <iostream> #include <fstream> #include <iomanip> #include <v... (by lastchance)
How to stop user from entering a same number twice?
 
Write your question here. #include <iostream> #include <stdlib.h> #include <time.h> using namespace std; const int MIN_NUMBER = 1; const int MA...
[2 replies] Last: Use a std::set<int> to hold the numbers which were already entered, ... (by JLBorges)
April 2018 Pages: 123... 25
  Archived months: [mar2018] [may2018]

This is an archived page. To post a new message, go to the current page.