#include <iostream>using namespace std; class c1{ public: class c2 { protected: static int func(int i); }; public: int a1; private: int a2;}; int c1::c2::func(int i){ c1::a2= 1; printf("func"); return 0;} int main() { //c1::c2::func(0); return 0;}
Standard input is empty
prog.cpp: In static member function ‘static int c1::c2::func(int)’: prog.cpp:16:7: error: invalid use of member ‘c1::a2’ in static member function int a2; ^ prog.cpp:21:6: error: from this location c1::a2= 1; ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!