Monday, 19 August 2013

Difference between Declaring a variable , Defining a variable ,Internal static variable and External static variable

Declaring a variable

Declaring a variable means describing its type (data type) but not allocating any space for it.

Defining a variable:

Defining a variable means declaring it and also allocating space to hold the variable. and it may be initialize at the time it is defined.

1.Internal static variable

An internal static variable is declared inside a block with static storage class.An internal static variable has persistent storage,block scope and no linkage.

2.External static variable

 An external static variable is declared outside all the blocks in a file and  has permanent storage,file scope and internal linkage.

0 comments:

Post a Comment