VS 2005: problems with running C++ programs

Hi, I want to run the simplest possible C++ program (Hello World) on VS 2005 . When I build it I receive no errors, but I do not see the output on the command line. I tried other short programs and it is still not working. Do you have ideas how to fix this problem? thanx
[277 byte] By [nuttyDeedee] at [2008-2-27]
# 1

try this:

#include <stdio.h>

void main() {

printf("Hello world\n");

char ch;

scanf("%c",&ch);

}

ilogpasig at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Visual C++ Express Orcas...
# 2
Can you tell me what you typed and how many times did you tried?
Jonoboy at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Visual C++ Express Orcas...
# 3
Hi,
The purpose of the "scanf" is to stop the program from exiting after it prints "Hello world" because it's waiting an input from the keyboard.

If you run the program from within the IDE and without the "scanf", the program prints "Hello world" then prints, "Press any key to continue..."

But if you run the program by double-clicking the resulting stand-alone ".exe" file (and without opening a DOS console), it runs within a split second then exits. That's why you don't see any output.

ilogpasig at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Visual C++ Express Orcas...

Visual Studio Orcas

Site Classified