Having the following class definition, what will be the output of the program?
#include <iostream>
class A {};
template<class T> class B {
int i;
public:
int func(B<A>& c) {
c.i = 3;
return c.i;
}
};
int main() {
B<int> a;
B<A> b, c;
std::cout<<a.func(c)<<b.func(c);
}
Login in to like
Login in to comment