Originally Posted by madhu
i'm a C++ noob, and i'm trying to learn it and all. but anyways, i got Visual C++ 6.0 and am running XP, and i'm having issues running the EXE after i compile the program, it runs and all. but it shuts off before it shows the output. I fixed this problem before, but it was like 4 monthes ago and i havent messed with it since, but i forgot how. So, any ideas?
There are 2 ways to compile and run the program in MS VC++ 6.0 With Ctrl + F5 and with only F5. Now I would like to tell what will be the difference between the two in your case.
When you run the program with F5 the exe will start running and will eventually end without you being able to see the output you printed after the last scanf (user input). The best way to make the screen hold on the screen is to put a getch() at the end of the program and print something like Press any key to exit ...
Case: Ctrl + F5
When you run the program with F5 the exe will start running and will eventually end but giving you a message Press any key to continue ... which you have given in the above scenario. Now if you have given the getch method then it will be twice and to avoid that you
Am I not looking like programmer, giving case in the explanation as well.