#include <iostream>
using namespace std;

class Counter {
private:
    static int count;

public:
    Counter() {
        count++;
        cout << "현재 생성된 객체 수: " << count << endl;
    }
};

int Counter::count = 0;

int main() {
    Counter c1;
    Counter c2;
    Counter c3;
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: