Untitled

Anonymous
plain_text
09/04/2023 9:44 AM
380 B
20
Indexable
#include <iostream>
using namespce std;
class sample{
    public:
    static int a;
    static void getdata()
    {
        cout<<a<<endl;
    }
};
int sample :: a=10;
int main()
{
    sample s;
    cout<<sample::getdata()<<endl;
    sample::a=100;
    cout<<sample::getdata<<endl;
}
Editor is loading...