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