INLINE:
class Point{
int x;
int y;
public:
void setValues(int, int);
int getX(){return x;}
};
void Point:: setValues(int a, int b){
x=a;
y=b;
}
int main(){
Point t1, t2;
t1.setValues(1,2);
//cout<<t1.x<<endl;
//cout<<t1.y;
cout<<getX(t1);
return 0;
}
NORMAL:
class Point{
public:
int x;
int y;
public:
void setValues(int, int);
int getX();
};
void Point:: setValues(int a, int b){
x=a;
y=b;
}
int Point::getX(){
return x;
}
int main(){
Point t1, t2;
t1.setValues(111,222);
//cout<<t1.x<<endl;
//cout<<t1.y;
cout<<t1.getX();
return 0;
}
p.S. Should I be aware that there is difference which one way I use, or is that other mistake? Many thanks!!!(I thought this is not important, btu when I defined the function anohter way, it just did not work and that made me think!)