For some reason my operands are not storing the values in the private class, but they are all friends of the class... Where did I go wrong on this code?
Code:class Diamond{ friend bool operator+(Diamond); friend int size(Diamond); public: Diamond(); Diamond(int); private: int size_of; }; bool operator+(Diamond d) //expand_size { int tmp; tmp = d.size_of + 2; if (tmp < 40 && tmp > 1) { d.size_of = tmp; return true; } else return false; }



LinkBack URL
About LinkBacks



