I can do this
extern int i;
extern int i;
But I can\'t do the same with a class
class A {
..
}
class A {
..
}
The closest equivalent to extern int i
with a class is a forward declaration, which you can do as many times as you like:
class A;
class A;
class A;
class A{};
When you define the actual class you are saying how much memory is required to construct an instance of it, as well as how that memory is laid out. That's not really the issue here, though.