I've never officially learned about classes, I just use them all the time but never really understand them. So a few questions:
1) What is the purpose of the desctructor? Does it just clear up memory?
2) What's wrong with this?:
Thanks in advance.Code:class square_info { private: float h, w; public: square_info () { h = 0; w = 0; } square_info (float height, float width) { h = height; w = width; } void print() { cout << "h: " << h << " | w: " << w << endl; } ~square_info(); //adding this line gives linking errors? };




Reply With Quote