Hi
How can I ask the compiler not to close the console till the user pushes the enter button or ...?
there should be sth better than:
Code://the main body of the code . . . char temp; cin>>temp; return 0;
Thanks
Hi
How can I ask the compiler not to close the console till the user pushes the enter button or ...?
there should be sth better than:
Code://the main body of the code . . . char temp; cin>>temp; return 0;
Thanks
See the FAQ section, and do a search of forum, this is a very common question
Last edited by rogster001; 10-06-2010 at 03:34 AM.
Thought for the day:FLTK: "The most fun you can have with your clothes on.""Are you sure your sanity chip is fully screwed in sir?" (Kryten)
Stroustrup:
"If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"
Thanks
It has been a long time since my last C++ code and I had completely forgot about
Code:cin.get();
Believe it or not,
SourceForge.net: Pause console - cpwiki
On windows, you can just putabove theCode:system("pause");line. Many people don't recommend this because it's not portable to another operating system. It works perfectly for just building practice programs in Windows though.Code:return0; }
Maybe the system("pause") was mentioned. But it did not mention where to put it, and it also did not mention that it's fine to use when just practicing on a your PC at home or school. It also did not mention what portable meant, and when portability matters. So I stated those facts, to try and help him out. Suggest you mind your own business and don't tell me what to do when I'm trying to help a beginning programmer.
Honestly, you cannot figure out where to put it?
I think the OP has already figured out that part.
The article lists several alternatives which are better than yours, works almost as well and are portable....and it also did not mention that it's fine to use when just practicing on a your PC at home or school.
So you could have googled, or just mentioned that.It also did not mention what portable meant, and when portability matters.
Then I suggest that you should pay more attention to what replies mention before you reply, as well. And perhaps you should at least try to promote portability. That's what this forum is all about, after all.So I stated those facts, to try and help him out. Suggest you mind your own business and don't tell me what to do when I'm trying to help a beginning programmer.
I'm not even going to argue about this anymore. You act like such a little immature brat in all of your posts, it's easier just to ignore you. I mean seriously, who else would I get into an argument besides you for trying to explain to someone what a few terms mean?
And another thing, I think this forum is more about trying to help people with what they ask rather trying to promote portability. Portability can kiss my ass. Now excuse me while I go write a VB program that I could never do in C++.
Nick, you're the one that got aggressive from the beginning over nothing. Telling someone to mind their own business on a public forum wont fix anything. The OP likely already had a solution from previous post. You should chill out. You go ahead and write some program in VB I'm sure nobody here cares.
Last edited by Syscal; 10-07-2010 at 08:06 AM.
No, it's not. It's about helping users while also teaching them to write standard C++ with portable code. So yes, we do promote portability.
You can go write whatever you want in VB. No one here is going to care. After all, just because you can't do it doesn't mean we can't do it.