For some reason the cin.ignore(1) is not working. It still enters the infinite loop. The cin.clear() works perfect, but I still wanted to try your advice. Any idea why this doesn't work?
...
Type: Posts; User: MedicKth
For some reason the cin.ignore(1) is not working. It still enters the infinite loop. The cin.clear() works perfect, but I still wanted to try your advice. Any idea why this doesn't work?
...
Wow that was simple. It works great. Thanks Pratip. Now I'll go read up on that to see exactly what it does. :)
And thanks for all of the other replies too. I learned something new from each...
As I have it now, It gets a name, midterm grade, final grade and then homework grades until an EOF is reached. When the user enters and EOF (ctrl z, is this correct?) it then waits until Enter is...
Ok, I'm going to post the code I have so far so somebody can tell me if I'm way off base here. I'm still not able to get it to ask if there are more students. As always any and all help is GREATLY...
Thanks for the links, but I'm still not getting it to work. I'm honestly not even sure what to ask now. I've tried everyway I can think of using the info in the example you provided with no luck. ...
Thanks Cat.
I understand your explanation. Great help.
Is there a way to flush the input buffer or is there a better solution? (i'm very new at this if you haven't figured that out yet :) ...
Ok, this is another question I hate to even post but here goes.
The program never waits for an input for cin >> newstudent .
I have determined that the "while(cin >> x)" is the problem by...
Ok. Feeling stupid but I got it. I knew I should've just put away 'till morning. Thanks for your help though. Just needed a kick in the head.
Ok, I should probably just wait and look at it again tomorrow before posting this because I know I should be able to figure it out. But.......
I get the error " 'fail' undeclared " It is...
Ok, Thanks again. It is now working the way the book intended I believe. (including just the .h file in the main program)
I think the problem was that I wasn't compiling everything at the same...
Thanks for the quick reply and it does make things a little clearer.
However I'm still confused on why the book has me include the .h file and not the .cpp. Maybe i'm just looking at it wrong.
...
Another newbie question.....
I put together my first program (actually entered from book) using user defined header files and recieved a linker error:
undefined reference to .......
I...
Thanks again for all the help. I'm moving on to the other excercises but I'm definately taking notes from all of the replies to look into for these other programs and improving this one later.
I...
Thank you greatly for all of the advice. I have written the following code based simply on aerian's advice, prior to reading the other's. I will go ahead and post it while I ponder the rest.
...
Hi, I'm new to these boards as well as programming. I'm working my way through "Accelerated C++" by Koenig and Moo. I'm happy with this book except for the fact that it does not provide solutions...