Oh, and I forgot to ask, how do I give definitions for functions. Sometimes when I use an external library (SFML for example), some functions have a short definition to go on.
void function(string)
{
cout << "You did not give an int.";
}
void function(string str,int)
{
cout << str;
}
or a default parameter (only if there's an int value that can be considered "invalid"):
1 2 3 4 5
void function(string str,int iParam=-1)
{
if (i!=-1)cout << str;
else cout << "You did not give an int.";
}
If there is no such invalid value, another option would be to use a pointer:
1 2 3 4 5
void function (string str,int* iParam)
{
if (iParam)cout << str;
else cout << "You did not give an int.";
}
Oh, and I forgot to ask, how do I give definitions for functions. Sometimes when I use an external library (SFML for example), some functions have a short definition to go on.