why we can't declare a static variable incide local class(class inside a function) ?
Neelam_1 0 Newbie Poster
Recommended Answers
Jump to Post@deceptikon: You misunderstood what the OP was referring to. She is referring to a local class, not a nested class. In other words, this is the case in question:
void f() { class inside { public: static int x; // Forbidden! }; };
And the explanation …
Jump to PostDeceptikon, I'm not sure your answer was apropros to the question. It was being unable to declare a static variable inside a class defined inside a function. Honestly, I have never done that! IE, something like this I think is what (in my interpretation of the post) he meant (I …
All 5 Replies
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Neelam_1 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.