Despite the fact that your question has already been answered fairly well, I think it's worth mentioning another question about your code. You have the following ads right now:
class frag { public: frag myfunc (frag oper1, frag oper2); frag myfunc2 (frag oper1, frag oper2);
... and you have the following functions:
frag myfunc (frag oper1, frag oper2) { return oper1 + -oper2; } frag myfunc2 (frag oper1, frag oper2) { return oper1 + oper2; }
I would suggest that you use these two functions to implement member functions declared in frag , but they do not. Instead, you have two member functions that are never declared defined, and these two are global functions that have similar names. In order for them to be member functions declared by you, you need to change the declaration to something like:
frag frag::myfunc(frag oper1, frag oper2) { return oper1 + -oper2; } frag frag::myfunc2(frag oper1, frag oper2) { return oper1 + oper2; }
On the other hand, this also makes no sense - in particular, as member functions, they are usually called something like: a.myfunc(b,c); They are both written as global functions, although they usually take only one parameter as member functions and use this as the first parameter:
frag frag::myfunc1(frag oper) { return *this + -oper; } frag frag::myfunc2(frag oper) { return *this + oper; }
Of course, this can be an accidental side effect of trying to reduce the source code to the minimum necessary for publication. If so, please feel free to ignore this whole "answer" ....