That is, indeed, very strange. There is nothing wrong with that code at all. It should compile and run just fine (I just copy-pasted that and triple-checked on my machine and it works fine over here).
Maybe it's some weird VS setting. When you created your new project, was there a setting to select whether or not it was a console program? Make sure you have that selected if there is such an option. Other than that I don't know what could be wrong.
Helios , i think , i should do the same , reinstall the stuff.
@kbw , i created Win32 Console Application and started of with the empty project itself.
I even tried by unchecking the Predefined Headers.
I think the last resort to all this stuff is: Reinstalling.
And yea , one thing more. Actually , i haven't installed Visual Studio in my root directory.
Since my root directory has a very less space left. Maybe that could trigger the problem ?
More over it does install some extra files into the root.
So i think , i need to run a disk clean up ?
Actually my D: Drive is the root drive.
VS installs anywhere. The location shouldn't matter, as long as it's installed and not copied.
You could use the menu: Tools->Options->Projects and Solutions->VC++ Directories. Then select "Include files" and check that the paths point to the C++ header files.
Hey! Kbw , well , thanks for the prompt reply. But since many days i was finding my O/S behaving very unusual. Even the partitions i made the last time were nonsense. So i decided to re-install my O/S since many programs weren't working as they generally do.
Finally i re-installed my O/S and yea , i'm now going to install VISUAL STUDIO 2008! Hope there will not be any problem such that. If it still persists i will definitely try your way out!