Untitled
unknown
plain_text
2 years ago
296 B
6
Indexable
class Count {
private:
int value;
public:
// Constructor to initialize count to 5
Count() : value(5) {}
// Overload ++ when used as prefix
void operator++() {
++value;
}
void display() {
cout << "Count: " << value << endl;
}
};
Editor is loading...
Leave a Comment