1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <stdio.h> class fruit{ private: int a; public: int b; fruit(){ a = 2; b =3; } static void set(){ fruit f; printf("%d",f.a); } }; int main(){ fruit::set(); return 0; }
1
2