|
-
October 15th, 2010, 10:17 AM
#9
Re: Beginner's use of system("pause");
Yeah, this conversation probably got dragged out a bit.
As for me abusing the pause function, well yes, yes I am, but the point is that no function should work "As long as you don't call it too much".
And yes, maybe the implementation of the pause function is not optimal, but I'd be willing to bet you'll never be able to find a stream-based implementation I can't break!
As a matter of fact, imagine a program that reads from cin and pauses every time it reads "hello". Run that program feeding it a file as input.
My gripe is that people say "Don't use system("pause"), it's bad" but there is no real portable equivalent. I think the "best" implementation for pause is the one that has a different implementation per system.
Is your question related to IO?
Read this C++ FAQ article at parashift by Marshall Cline. In particular points 1-6.
It will explain how to correctly deal with IO, how to validate input, and why you shouldn't count on "while(!in.eof())". And it always makes for excellent reading.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|