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;
}