|
-
February 15th, 2009, 02:37 AM
#3
Re: cin.get(); Doesn't Work for me... Anyone ??
 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.
 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.
 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.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|