User info | |
---|---|
User name: | fabrocket |
Bio: | #include <cstdlib>
#include <iostream> using namespace std; class CVector { public: int x,y; CVector () {}; CVector (int a, int b); CVector operator + (CVector param); }; CVector::CVector (int a, int b) { x = a; y = b; } CVector CVector::operator+ (CVector param) { return CVector(param.x+x,param.y+y); } int main () { CVector a (7,1), b (1,2), c; c = a + b; cout << c.x << "," << c.y; return 0; } |
History | |
Joined: | |
Number of posts: | 2 |
Latest posts: |
This user does not accept Private Messages