0
Which of the following function prototype is perfectly acceptable?
int Function(int Tmp = Show());
4 ответов
+ 5
@Babak
The catch appears to be that show's forward declaration has to be declared before func(). You code is valid as it is. Does this pertain to Vaishnavi's original post?
+ 4
But we are only given one function prototype to choose from. :x
+ 4
int show();
int func(int t = show());
int main() {
cout << func();
}
int show() { return 10; }
int func(int t) { return t + 1; }
So, what do you say Hatsy Rei ? ;)
+ 3
That's right , hatsy. I thought the missing part was the undeclared function show() which acts as a default value provider for the formal parameter of the second function. And I figured to put together a simple snippet that possibly gives a better view of the incomplete one-liner declaration. Hopefully that's what the OP's intention was about. Thanks! ;]