C++9

PHOTO EMBED

Fri Sep 16 2022 09:14:10 GMT+0000 (Coordinated Universal Time)

Saved by @kodekutulisanku #c++

#include <iostream>
using namespace std;
class Test
{
    static int x;
  public:
    Test() { x++; }
    static int getX() {return x;}
};
int Test::x = 0;
int main()
{
    cout << Test::getX() << " ";
    Test t[5];
    cout << Test::getX();
}
content_copyCOPY