Like the others said, you probably created the wrong type of project with Visual C++....
Make sure you create a console app...

Ammo

BTW, you should have said a "C++ problem" as your code is C++...