-
Newbie Programmer
Ok I admit I'm a total newbie, never even opened up a programming interface before lol
So I'm wondering why I'm making executables just fine but they don't run. I did everything right so Ii figure it might because I'm using Windows XP (Gawd I need to get Mandrake back! :D ).
I have no clue why but not even the most simple project runs.
Anyway I wondered if anyone could help this clueless newbie programmer :confused:
Thanks a bunch :)
-
It may be running but the results are removed from the screen so fast you can't see the results. What compiler are you using? Consider using any one of a number of the following lines just before the return 0 at the end of your code:
Version 1:
char ch;
cin >> ch;
Version 2:
getch();
Version 3;
cin.get();
If none of those work, post code using code tags as described in the instructions at the top of the forum.
-
use version 3...
version 1 allocates one extra byte you don't need (not too big of a deal)
version 2 isn't very portable, although it does continue the program even if the user presses the 'j' key...
version 3 only continues if the user presses enter
you could also look up kbhit() if you want any key on the keyboard to restart the flow of the program, but usually cin.get() is good enough...
another thing is you may want to check your documentation... you may just be compiling/linking/etc. without running... every compiler I've worked with has seperate options to complete seperate parts of the process...
-
How about posting an example of what you tried.
"It didn't work" is pretty useless