program output display window disappears in a fraction of a second

This is a discussion on program output display window disappears in a fraction of a second within the C++ Programming forums, part of the General Programming Boards category; hi, i am a beginner in cpp programming. when i was writing program to learn structures, the output of the ...

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    1

    program output display window disappears in a fraction of a second

    hi,

    i am a beginner in cpp programming. when i was writing program to learn structures, the output of the program disappears after a fraction of a second. i am not even able to see the output. the output window stayed on the screen the first time i run the program, but not afterwards.

    i have used getchar();

    where am i going wrong?

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,198
    At a guess, since you haven't shown any code, your program is terminating in some way without calling getchar().

    That can happen if you call exit(), return from main(). It can also mean your code is doing something that causes the program to terminate abnormally - which is probably the most likely explanation.

    Either step through your program with a debugger, or add more calls of getchar() to help localise the concern.
    Right 98% of the time, and don't care about the other 3%.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. c program that accepts and executes commands?
    By Cimposter in forum C Programming
    Replies: 3
    Last Post: 09-30-2009, 02:58 PM
  2. Adding buttons, edit boxes, etc to the window
    By rainmanddw in forum Windows Programming
    Replies: 1
    Last Post: 04-10-2006, 03:07 PM
  3. How do you read gzip output from 'C' program?
    By brett in forum C Programming
    Replies: 5
    Last Post: 03-12-2006, 11:01 PM
  4. Problem with creating new window, from another window
    By Garfield in forum Windows Programming
    Replies: 6
    Last Post: 01-11-2004, 01:10 PM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 09:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21