0
HELP !!! C++
Operator overloading last question help C++ HELP !!! Test Test:: (Test obj) { newObj; newObj.mem = mem obj.mem; return newObj; }
13 Respuestas
+ 3
Test Test::operator+(Test obj) {
Test newObj;
newObj.mem =
mem + obj.mem;
return newObj;
}
+ 1
Here you go.
Test Test::operator+(Test obj) {
Test newObj;
newObj.mem = mem+obj.mem;
return newObj;
}
+ 1
Test Test::operator+(Test obj) {
Test newObj;
newObj.mem =
mem + obj.mem;
return newObj;
}
+ 1
Test Test::operator+(Test obj) {
Test newObj;
newObj.mem =
mem + obj.mem;
return newObj;
}
0
You just declared "newObj" without specifying it's data type. Write "Test" before the "newObj" and see if it works.
0
Here you go.
Test Test::operator+(Test obj) {
Test newObj;
newObj.mem = mem+obj.mem;
return newObj;
}
Hope it helps.
0
class Student {
public:
Student();
Student();
};
0
Test test:operator+(Test obj) {
Test newObj;
newObj.mem = mem + Obj.mem;
return newObj;
}
0
fatma
class Student {
public:
Student();
~Student();
};
0
type in the keyboard name to store the address of the current object.
ANSWER: This
0
what is the keyboard for overloading an operator in c++?
ANSWER: operator
0
what does oop stand for?
ANSWER:-
Object oriented programming
0
thanks all for your support