Thread: Moving on
View Single Post
Old
legolizard
Senior Member
 
legolizard's Avatar
 
Status: Offline
Posts: 242
Join Date: Jan 2011
Location: Aboard the Hyperion escaping the zerg.
Default 08-07-2011, 02:12 PM

This is because the C++ standard main() is of integer type not of void type. Your book uses Microsoft's version of the main(), which is of course not standard and will only work in compilers made by Microsoft say Microsoft Visual Studio, which I believe you must buy after a trial period. You can still use your book however replace:

Code:
void main()
{
//Some code.....
}
with:

Code:
int main()
{
//Some code....
return 0;
}


"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."-Albert Einstein

Last edited by legolizard; 08-07-2011 at 02:24 PM.
   
Reply With Quote