Possible Duplicate:
Default values for array arguments
How do I give an array as the default parameter to a function? I tried this:
void drawCircle(float radius, GLfloat colour[3]={2.0, 3.0, 4.0}, bool do=true) {
...
}
The part GLfloat colour[3]={2.0, 3.0, 4.0} gives me an error. Is this possible in C++?
You cannot pass an array by value, and so you cannot do that.
So the workaround is, overload the function as:
Second and third function eventually call the first function!
Also note that
dois a keyword, so you cannot use it as variable name. I replaced it withpleaseDo😀