Hi programer

Discussion in 'Meet and Greet' started by sam_mcgowan, Sep 2, 2006.

  1. sam_mcgowan

    sam_mcgowan New Member

    Joined:
    Sep 2, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Hi I am new to both programing and the forum, I wish this one to be very learning experience for me.
    Cheers!
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Yes sure you will have. Welcome to G4EF.
     
  3. sam_mcgowan

    sam_mcgowan New Member

    Joined:
    Sep 2, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Hi Shabbir thanks for the welcome.
    I have VERY basic question. I have just started learning c++. My problem is when I comile and run my first program (just to print " Hello World"). The the result window disappears in a fraction of a second and I can not view the result. I use Dev-C++ free compiler. Is there any way I can see the result window for a longer time.
    Thanks for looking at very basic question.
    I hope to get some solution and try running more programs over this labor day weekend.
    -Sam_mcgowan
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Try using getch() function before the return statement of the main function and you should see the window not disappear until you press any key. getch() is defined in conio.h file and so may need to include the header file as well.
     
  5. sam_mcgowan

    sam_mcgowan New Member

    Joined:
    Sep 2, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Thanks! amazingly it worked! This will help me ramp up building new programs and running them.
    Just now I also found another way in the software FAQ: use of- system ("pause"); along with inclusion of stdlib.h.
    Maybe there are several other avenues to pursue one thing!
     
  6. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Yes thats true. pause is a system command and may not work on any other OS apart from DOS.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice