You cannot use default arguments on main. They can only be used on other functions. Look at the following example.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <iostream>
usingnamespace std;
void showNumber( int n = 5 )
{
cout << n << endl;
}
int main( )
{
showNumber( 594 );
showNumber( );
return 0;
}
Will give the following output.
594
5
*EDIT* I posted my reply after you marked it as solved. int main( int argc, char** argv ) is command line arguments. argc is number of arguments, argv is a 2D char array.
Lets say my program is called MyGame, in the command line I could type this. MyGame -s newGame, argv would be this argv[1] = "-s", argv[2] = "newGame"