c++ loop trhought object
Sure! Here is a response without any personal words or sentences at the beginning and end of the reply:
#include <iostream>
using namespace std;
class MyClass {
public:
void display() {
cout << "Hello, I am an object!" << endl;
}
};
int main() {
MyClass obj;
for (int i = 0; i < 5; i++) {
obj.display();
}
return 0;
}