+ 1
why not this program output 7 and why it shows compiler error ??? #include<iostream> using namespace std; class a{ public: int f(){cout<<3;} int f(int a){cout<<a;} }; class b:public a { public: int f(){cout<<5;} }; int main() { b obj; obj.f(7); }
3 Respuestas
+ 2
And also change the return type of all functions to void as no one is returning any thing
- 2
Return 0 in main and change the function name in the child class don't save it as f.
- 5
#include<iostream> between e and < must be space