locked
how get result on the display

    Question

  • hello everybody

    I am first time face with visual studio 2010 express. And I type a code and execute succ. but I don't know how to display the result on the display..........

     

    Thursday, November 17, 2011 8:11 AM

Answers

  • >I don't know how to display the result on the display.

    Could you be more specific? Do you mean you don't know
    how to write code which will show output on the computer
    screen? Or do you mean that the output from your program
     - such as from printf() ot cout - can't be seen?
     
     - Wayne
    • Marked as answer by Rob Pan Thursday, December 01, 2011 8:36 AM
    Thursday, November 17, 2011 10:02 PM
  • you said that it it executed successfully.. try debugging without errors.. or else directly open the .exe file in your project file after compilation to see your result
    We create the magic world
    • Marked as answer by Rob Pan Thursday, December 01, 2011 8:36 AM
    Tuesday, November 22, 2011 4:25 PM
  • As you mention that your program runs, I suspect your problem is that the command window is closing when execution completes, giving you nothing to look at.

    You can solve thi by adding the following two statements as the last two statements in your main()

    cout << "Hit Enter to end program.\n";
    cin.get();
    

    This code will effectively pause your program, keeping the command window open, until you hit a key on the keyboard.

    • Marked as answer by Rob Pan Thursday, December 01, 2011 8:36 AM
    Wednesday, November 30, 2011 5:45 PM

All replies

  • >I don't know how to display the result on the display.

    Could you be more specific? Do you mean you don't know
    how to write code which will show output on the computer
    screen? Or do you mean that the output from your program
     - such as from printf() ot cout - can't be seen?
     
     - Wayne
    • Marked as answer by Rob Pan Thursday, December 01, 2011 8:36 AM
    Thursday, November 17, 2011 10:02 PM
  • you said that it it executed successfully.. try debugging without errors.. or else directly open the .exe file in your project file after compilation to see your result
    We create the magic world
    • Marked as answer by Rob Pan Thursday, December 01, 2011 8:36 AM
    Tuesday, November 22, 2011 4:25 PM
  • As you mention that your program runs, I suspect your problem is that the command window is closing when execution completes, giving you nothing to look at.

    You can solve thi by adding the following two statements as the last two statements in your main()

    cout << "Hit Enter to end program.\n";
    cin.get();
    

    This code will effectively pause your program, keeping the command window open, until you hit a key on the keyboard.

    • Marked as answer by Rob Pan Thursday, December 01, 2011 8:36 AM
    Wednesday, November 30, 2011 5:45 PM
  • Hi! do not torture yourself, just key f7 - a compilation, and key ctrl + F5 to leave your program's on hiatus after!
    • Edited by virus8 Monday, December 05, 2011 10:58 PM
    Monday, December 05, 2011 10:57 PM