Re: Visual C++ Express 2008 (Pre-release) VS 2005: problems with running C++ programs
ilogpasig
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.