Hi Group,
sorry, its again me with a dumb question.
If i have a function with the optional parameter "mode" like this:
void myfunc(char *blah, int mode = NULL)
{
if(mode == NULL)
do_something();
else
do_something_else();
}
and i want to have a prototype for this function in my header-file and so i
write:
void myfunc(char *blah, int mode = NULL);
I get a compile error: redefenition of mode
If i write:
void myfunc(char *blah, int mode);
and i use the function with a function call like this:
myfunc("Hello World");
I got a compile error: function does not take 1 Parameter.
But i want to have the mode-param. optional. So you can call the function
with two parameters or with one and using the default value for "mode".
How have i to do this to keep the compiler (and me :-)) ) happy?
Someone out there who is willing to enlighten me a little bit? Thanks a
loooot!
CU
Joerg Toellner