New student

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!
It means that if you don't supply a value to flag when calling the function, it will default to true.
Thanks,
But what means is this "void foo(int x, bool flag /* = true */)"

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.
Great, Thanks All !
Topic archived. No new replies allowed.