c - Variable declarations and datatypes -
in following statements first 3 definitions , last 1 declaration:
auto int i; static int j; register int k; extern int l;
what's reason same?
in first three(int i, static int j, register int k) definition. denotes space integer in translation unit , advices linker link references against entity. if have more or less 1 of these definitions, linker complain.
but in last extern int l, declaration, since introduces/specifies l, no new memory address/space allocated. can have many extern int l in each compilation unit want. declaration introduces names translation unit or redeclares names introduced previous declarations.
Comments
Post a Comment