Is it possible to set values for default parameters in C? For example:
void display(int a, int b=10){
//do something
}
main(){
display(1);
display(1,2); // override default value
}
Visual Studio 2008, complaints that there is a syntax error in -void display(int a, int b=10). If this is not legal in C, whats the alternative? Please let me know. Thanks.
Default parameters is a C++ feature.
C has no default parameters.