++ operator
--------------1-----------------
void operator ++ (){
this->num = (* this).num + 1; //calling object is incremented by 1
}
--------------2-----------------
int operator ++ (){
return ((* this).num + 1); //returned copy of calling object incremented by 1
}
--------------------------------
which version is correct 1, 2 or both ??? and why???
-------------------------------------------------------------
= operator
--------------1-------------
void operator = (type obj){
* this = obj; //calling object is updated to copy of obj
}
--------------2-------------
type operator = (type obj){
return obj; //calling object receives a copy of obj and can update itself according to instructions in copy constructor
}
--------------------------------
which version is correct and why???