Is there any difference between getA()&getB() and setA()&setB() ?
If they are the same, which is the preferred syntax?
class A{
public:
int x;
int getA(){return x;}
int getB(){return this->x;}
void setA(int val){ x = val;}
void setB(int val){ this->x = val;}
};
int main(int argc, const char * argv[]) {
A objectA;
A objectB;
object.setA(33);
std::cout<< object.getA() << "\n";
objectB.setB(32);
std::cout<< object.getB() << "\n";
return 0;
}