1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

C++ noob help.

Discussion in 'C++' started by madhu, Aug 21, 2005.

  1. madhu

    madhu New Member

    Joined:
    Jul 25, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    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?
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83
    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
     
    Last edited: Aug 21, 2005
  3. coderzone

    coderzone Super Moderator

    Joined:
    Jul 25, 2004
    Messages:
    734
    Likes Received:
    37
    Trophy Points:
    0
    I really thought so
     
  4. madhu

    madhu New Member

    Joined:
    Jul 25, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    Thanks for the help. Lots of things were just too good for me to catch but at the end did it succesfully
     

Share This Page