C++12

PHOTO EMBED

Sat Sep 17 2022 03:55:35 GMT+0000 (Coordinated Universal Time)

Saved by @kodekutulisanku #c++

#include<iostream>
using namespace std;
class Test
{
   private:
     static int count;
   public:
     Test& fun(); 
};
int Test::count = 0;
Test& Test::fun()
{
    Test::count++;
    cout << Test::count << " ";
    return *this;
}
int main()
{
    Test t;
    t.fun().fun().fun().fun();
    return 0;
}
content_copyCOPY