Void in main and keeping Dos program from dying

Posted by TimothyTech on Stack Overflow See other posts from Stack Overflow or by TimothyTech
Published on 2010-06-09T20:48:00Z Indexed on 2010/06/09 20:52 UTC
Read the original article Hit count: 246

Filed under:
|

Alright, so im using bloodshed complier, first thing i should note is im using a 2001 edition C++ for the aboslute beginner, was there any changes to C++ since 2001 that would effect the validity of this book? i ask because i know php has php5 and now php6 but i havent seen any C++3.

now for the reason i asked that, in this code it uses,

void main (void)

why would i want an arguement to be void? what does this do.

But when i run the " void main (void) in my compiler it says that main must have a "int" before it. so i cant have "void" main (void);

also, once the code runs through, as long as there isnt a "cin" the program closes. is this normal behavior, is there a better way to stop this besides making a cin at the end of my program.

© Stack Overflow or respective owner

Related posts about c++

Related posts about void