Nesting an object in a class [closed]
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Using C++ I'm trying to nest an object of one class inside another class and I get a syntax error on line 6 of CarpetClass.h that says Error: fuction "Rectangle" is not a type name myclass.h class Rectangle{ private: double length; double width; public: void setLength(double len){ length = len; } void setWidth