Why can't I multi-declare a class

前端 未结 9 1315
我在风中等你
我在风中等你 2021-01-12 04:03

I can do this

extern int i;
extern int i;

But I can\'t do the same with a class

class A {
..
}
class A {
..
}
9条回答
  •  青春惊慌失措
    2021-01-12 04:35

    But in the first case ther is no contradiction.

    extern int i;
    extern double i;
    

    won't work either. So if you create class A to times it wouldn't be possible to decide who A is.

提交回复
热议问题