Thread: program output display window disappears in a fraction of a second

  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,815
    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%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

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-13-2006, 12:01 AM
  4. Problem with creating new window, from another window
    By Garfield in forum Windows Programming
    Replies: 6
    Last Post: 01-11-2004, 02:10 PM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM