Can we see the output of program at dos prompt

Discussion in 'C++' started by kabirk007, Dec 10, 2008.

  1. kabirk007

    kabirk007 New Member

    Joined:
    Dec 2, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    hi everybody,

    anybody can tell me the way , how can i check my 'c' program output at dos prompt

    plz. confirm this ASAP.

    thanks
    Amit
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    What compiler you are using because running the program should show you the output
     
  3. neo_vi

    neo_vi Member

    Joined:
    Feb 1, 2008
    Messages:
    720
    Likes Received:
    16
    Trophy Points:
    18
    Occupation:
    Software engineer
    Location:
    Earth
    Home Page:
    http://computertipaday.blogspot.com
    if u cannot see the output jus add a line in the end of the program
    Code:
    getch();
    If it returns any error include the conio.h header at the beginning
     
  4. skp819

    skp819 New Member

    Joined:
    Dec 8, 2008
    Messages:
    89
    Likes Received:
    3
    Trophy Points:
    0
    write the getch(); at the end of the program.
    getch(); is used for get one character from the user.
    by doing that after execution of the program it will hold the screen and when you press any key then it will go to source code.
     
  5. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    It depends why you can't see the output already. Does the window appear briefly then disappear before you get a chance to look at it? If so prompting for input as the last thing is one solution; running the EXE from a command prompt opened at the right place is another.
     
  6. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Just a silly question. Are you aware of printf / cout functions to display output.
     

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