Quantcast
Channel: Active questions tagged return-value - Stack Overflow
Viewing all articles
Browse latest Browse all 207

How do I deal with default values in extern functions?

$
0
0

The basic function:

void foo(int bar=99){};

And in the #include'd routine:

extern void foo(int);foo();

This doesn't compile as it says 1 argument is required for foo(). If I make it:

extern void foo(int=99);foo();

This also doesn't compile, saying the default value was previously specified. Ideally I'd want one default in the main routine, and a different default in the #include'd routine - is that possible?

I've also tried:

extern void foo(int bar=99);

Viewing all articles
Browse latest Browse all 207

Trending Articles