adspace
Answer Posted / Seema Sagar
A class in C++ is a blueprint for creating objects. It defines the data members (variables) and member functions (methods) that an object will have. Here's a simple example of a class representing a rectangle: `class Rectangle { private: int length; int width; public: void setLength(int l) { length = l; } void setWidth(int w) { width = w; } int getArea() { return length * width; } };`
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers