What will happen when you attempt to compile and run the following code?
#include
using namespace std;
class C {
public:
int _c;
C():_c(0){}
C(int c) { _c = c;}
C operator+=(C & b) {
C tmp;
tmp._c = _c+b._c;
return tmp;
}
};
template
class A {
T_v;
public:
A() {}
A(T v): _v(v){}
T getV() { return _v; }
void add(T & a) { _v+=a; }
};
int main()
{
A
A
Cc;
a.add(c);
cout << a.getV() < return 0; }
Patria
10 months agoLeota
10 months agoColeen
10 months agoWynell
10 months agoDanilo
10 months agoCassi
11 months agoRyan
11 months agoMireya
11 months agoDaron
11 months agoErinn
11 months agoElina
11 months ago