J
Jason
Hi there,
I'm new to C .. have a very basic question .. hope someone has the
patience to help!
I want to declare a function that has optional parameters and I want to
initialize the non supplied parameters .. how do I do this?
eg:
// this obviously isn't allowed .. but need to acheive something
similar
int function foo (int a=0, int b=0, int c=0, int d=0) {
// do something
return 0;
}
// I want to be able to call this function with any or all the
parameters
foo (2, 5,); // in this case a=2, b=5, c should be 0 and d should be 0
How do I accomplish this?
Thanks a bunch guys!
I'm new to C .. have a very basic question .. hope someone has the
patience to help!
I want to declare a function that has optional parameters and I want to
initialize the non supplied parameters .. how do I do this?
eg:
// this obviously isn't allowed .. but need to acheive something
similar
int function foo (int a=0, int b=0, int c=0, int d=0) {
// do something
return 0;
}
// I want to be able to call this function with any or all the
parameters
foo (2, 5,); // in this case a=2, b=5, c should be 0 and d should be 0
How do I accomplish this?
Thanks a bunch guys!