C ++ outer class definition

I am reading the code that goes:

extern class MyClass : BaseClass { ... } MyInstance; 

Is extern a reference to a class or instance declaration?

+4
source share
1 answer

Instance. Classes cannot be extern.

Although the code smells, this snippet suggests that the true declaration of this instance uses a separate class definition. The bad, bad idea is to define the class twice.

+6
source

All Articles