C Tutorial C Storage classes
The C Language
C History
BCPL
Euclid’s Algorithm in C
Euclid on the PDP-11
Pieces of C
C Types
Declarators
Struct bit-fields
Code generated by bit fields
C Unions
Layout of Records and Unions
C Storage Classes

malloc() and free()
Dynamic Storage Allocation
Simple Dynamic Storage Allocation
malloc() and free() variants
Fragmentation
Fragmentation and Handles
Automatic Garbage Collection
Arrays
Lazy Logical Operators
The Switch Statment
setjmp/longjmp: Sloppy exceptions
Nondeterminism in C

 

 

HOME
 


 

C Storage Classes

/* fixed address: visible to other files */ 

int global static;

/* fixed address: only visible within file */

static int file static;

/* parameters always stacked */

int foo(int auto param)

/* fixed address: only visible to function*/

static int func static;

/* stacked: only visible to function */

nt auto i, auto a[10];

/* array explicitly allocated on heap (pointer stacked) */

double *auto d =malloc(sizeof(double)*5); 

/* return value passed in register or stack */

return auto i;

}

 

Contact for more learning: webmaster@freehost7com