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

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 230

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>