First of all, no... never ever use the method Chococrack mentioned. It is for amateur programmers and a shitty habit to learn. Second... how are you using it? Show me your code.
packetpirate
Junior Poster in Training
60 posts since Jun 2010
Reputation Points: 10
Solved Threads: 3
Fbody
Posting Maven
2,930 posts since Oct 2009
Reputation Points: 833
Solved Threads: 393
n00bs all up in this thread.
cout + cin.get() is all you need in C++
printf() + getchar() is all you need in C
MosaicFuneral
Posting Virtuoso
1,691 posts since Nov 2008
Reputation Points: 888
Solved Threads: 116
#include
#include
#include
#include
This won't work at all using most compilers. I dare you to try it on VC++. Using O/S and compiler dependent solutions are problematic. These include
* system("pause");
* Any Linux/Unix-only solutions: unistd.h and termios.h
* Non-standard C function getch() , defined only in particular compilers on one O/S
TheBEST answer is the original post in this thread. Please learn and understand why. Don't just post your favorite inadequate solution as the best way. In these forums we try to teach the proper way to do things, not the hackneyed way most people are taught by less-than-adequate programmers.
More here
Flaming another contributors post is definitely not the way to go about gaining a great reputation here.
There was no flame. The suggestion of system("pause"); is shitty. Nothing against you, just that suggestion.
cout + cin.get() is all you need in C++
printf() + getchar() is all you need in C
printf() is a huge hit on resources. If all you are doing it printing a character or a string, use putchar() and puts() repectively. :icon_wink:
WaltP
Posting Sage w/ dash of thyme
10,505 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
Ah, I've been p0wnd. I submit to your experience.
MosaicFuneral
Posting Virtuoso
1,691 posts since Nov 2008
Reputation Points: 888
Solved Threads: 116