cin.get(); /* i know this is soo wrong and bad but im just lazy in small test appls to use proper pause code here or to pipe output to a file */
This is actually one of the most portable and safest methods of pausing.
Just wanted to comment on that, I have no insight into a more effective algorithm.
jonsca
Quantitative Phrenologist
5,621 posts since Sep 2009
Reputation Points: 1,165
Solved Threads: 581
Is the solution posted here ( http://www.daniweb.com/forums/thread90228.html ) as a tutorial by narue not the best way as it handles more situations consistently? and i dont see that her code would not be portable?
Anyway many thanks for the feedback
I'm definitely not saying Narue is wrong in that case.
You can certainly flush the stream before you call the cin.get() but a cin.ignore() will get rid of a stray '\n' that could be picked up by your cin.get().
In your code comment, it sounded to me like you wanted to put in a system("pause"); , and that's more what I was trying to dissuade you from.
jonsca
Quantitative Phrenologist
5,621 posts since Sep 2009
Reputation Points: 1,165
Solved Threads: 581
pseudorandom21
Practically a Posting Shark
890 posts since Jan 2011
Reputation Points: 216
Solved Threads: 111