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

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -