Ok. do this:
remove getchar(); and compile it again. If you get no errors you can browse to the location of the program and run it from the command line. Also you could replace getchar(); with getch() from the conio.h library. Actually getchar() is just the c++ equivalent to getch().