-
short question on c++
hello all, ive been checking out this site for a bit now and am quite impressed by the feedback noobs get.
which is good because this is as noob a question as there is. ive done a few tutorials and believe that i know the basics and have decided to write my own program and continue learning from there.
ok, im attempting to write a short iq test however im stuck at the very beginning of the program. the problem is that i would like to add this: cout << "Please press enter to begin test. " << endl; however i do not know how to get rid of the default press enter to continue (which then quits the program and goes back to C++.
ive been searching for the answer for a bit now but i have not had any luck finding a solution.
thanks in advance
-totem
-
cout << "Please press enter to begin test. " << endl;
this simply prints that message to the console with a newline.
It doesn't require you to press enter.. yet you're probably using MS VC++6, that, when running apps from a workspace, the spawning process calls pause after your app exited.
or you have a getchar(), getch(), cin.get().. whatever, that it stoping your program.
-
Well the first step is to post the code you tried, along with saying which operating system and compiler you're using.
-
Like xErath said, it sounds like you're probably running your code from within the IDE where a nice "pause" is automatically added for your benefit so you can see any final output your program may have generated before the window disappears. Run your program outside of the IDE environment and you won't have that problem.
-
ok, i guess it is because im running it in ide. thanks for your answers.
one more question, is there a site you guys know of that has some sample beginner/amateur programs that i could sample to see how they work?
thanks
-
If u want to see some sample programs, look around on this site. You should go to the source code section, or the snippets section. The programs there usually contain comments and such that should help you understand how the program works. Or just look at different threads on this site, one of them is bound to contain source code. :)