j***a 发帖数: 832 | 1 f1.c
...
TYPE1 Variable_1;
f2.c
...
extern TYPE2 Variable_2;
Question: will there be any problem in the above code?
| l***g 发帖数: 1035 | 2 what problem? no problem.
【在 j***a 的大作中提到】 : f1.c : ... : TYPE1 Variable_1; : f2.c : ... : extern TYPE2 Variable_2; : Question: will there be any problem in the above code? :
| H***a 发帖数: 735 | | l***g 发帖数: 1035 | 4 not necessarily. extern only means compiler does not allocate memory, let th
e linker find it somewhere else.
of course for convenience you can put the var in the header as extern, and i
nclude that file for everyone.
【在 H***a 的大作中提到】 : extern 定义在*.h里吧
|
|