Newbie Programmer

This is a discussion on Newbie Programmer within the C++ Programming forums, part of the General Programming Boards category; Ok I admit I'm a total newbie, never even opened up a programming interface before lol
So I'm wondering why ...

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! ).
I have no clue why but not even the most simple project runs.
Anyway I wondered if anyone could help this clueless newbie programmer
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.

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...

Last edited by major_small; 05-18-2004 at 12:27 PM.
Reason: more added