// static data member or data method #include<iostream> using namespace std; class abc{ static int id; public: static void get() { cout<<id; } }; int abc::id=10; int main() { abc xz; xz.get(); }
10
// static data member or data method #include<iostream> using namespace std; class abc{ static int id; public: static void get() { cout<<id; } }; int abc::id=10; int main() { abc xz; xz.get(); }
10
0 Comments