Oct 29, 2008 at 7:07pm UTC
Hi, Dear.
void foo(int x, bool flag /* = true */)
{
...
}
what mean is this "flag /* = true */" ?
and
bool foo1 ( int *a, int x, bool y = true )
{
return(*(a + x) = y);
}
and why need set "y = true" at here ? what mean is this ?
Any one can help me ?
thanks for help!
Oct 29, 2008 at 7:19pm UTC
It means that if you don't supply a value to flag when calling the function, it will default to true.
Oct 29, 2008 at 8:14pm UTC
Thanks,
But what means is this "void foo(int x, bool flag /* = true */)"
Oct 29, 2008 at 8:16pm UTC
Probably in the prototype the function has flag set to true by default; in the actual implementation they cannot specify that again, so they put it in comments.