Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   C++ noob help. (http://www.go4expert.com/forums/cpp-noob-help-t413/)

madhu 21Aug2005 16:28

C++ noob help.
 
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?

shabbir 21Aug2005 16:45

Re: C++ noob help.
 
Quote:

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.

Case: F5
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.

Thanks
Shabbir Bhimani

coderzone 21Aug2005 16:58

Re: C++ noob help.
 
Quote:

Originally Posted by shabbir
Am I not looking like programmer, giving case in the explanation as well.

I really thought so

madhu 20Sep2005 19:45

Re: C++ noob help.
 
Thanks for the help. Lots of things were just too good for me to catch but at the end did it succesfully


All times are GMT +5.5. The time now is 05:59.