I'm a beginner in c++ beginner and I don't know how to fix the errors in this code. Could you please help me to find out what's wrong with it? Thank you so much!
#include<iostream>
using namespace std;
class vector{
public:
int xvalue;
int yvalue;
};
vector obj1;
vector obj2;
int main()
{
int mode;
cin >> mode;
if(mode == 0){
cin >> obj1.xvalue;
cin >> obj2.xvalue;
addvecx(obj1.xvalue, obj2.xvalue);
}
else if(mode == 1){
cin >> obj1.yvalue;
cin >> obj2.yvalue;
addvecy(obj1.yvalue,obj2.yvalue);
}
return 0;
};
int addvecy(obj1.yvalue, obj2.yvalue){
sum=obj1.yvalue+obj2.yvalue;
return sumy;
}
int addvecx(obj1.xvalue, obj2.xvalue){
sum=obj1.xvalue+obj2.xvalue;
return sumx;
}