Quote Originally Posted by Jeff++
it's the return 0; right ?
Yes, you probably want to swap the order of the cin.get() call and the return statement.

Alternatively, ditch the cin.get() call and run your program from the command prompt, or from an IDE that automatically pauses the program at the end, or by setting a break point with your debugger.

Quote Originally Posted by Jeff++
Won't a C++ program automatically return 0 if it was successful ?
Yes, the global main function returns 0 if control reaches its end without encountering a return statement.

Quote Originally Posted by Jeff++
why use it ?
Some people just want to be consistent with other functions since the global main function is special in this regard.