Showing posts with label Data Storage. Show all posts
Showing posts with label Data Storage. Show all posts

Monday, 31 October 2011

Variables and Data Storage

One of the C language’s strengths is its flexibility in defining data storage. There are two aspects that can be controlled in C: scope and lifetime. Scope refers to the places in the code from which the variable can be accessed. Lifetime refers to the points in time at which the variable can be accessed.

Three scopes are available to the programmer:

extern:


This is the default for variables declared outside any function. The scope of variables with extern scope is all the code in the entire program.


static: