C Language / Storage classes in C Language

It defines scope (visibility) and lifetime of variables and functions within the C Program. They were 4 storage classes in c Language. They were

Storage class Purpose
auto It defines a variable whose value is local to the function out of it no scope.
extern It defines a global variable whose scope is entire program.
static It defines a variable its value persists throughout the entire program.
register It defines a variable, value it’s stored inside the CPU Register and used for fast access.

Examples
Storage class Keyword used in the program Example
auto auto auto int vn;
extern extern extern int vn;
static static static int vn;
register register register int  vn;


Home     Back