Showing posts with label MEMORY ALLOCATION. Show all posts
Showing posts with label MEMORY ALLOCATION. Show all posts

INTRODUCTION TO MEMORY ALLOCATION IN "C"

=>FILE HANDLING IN C:

1) STATIC MEMORY ALLOCATION

2) DYANAMIC MEMORY ALLOCATION

BRIF DISCUSS ABOUT POINTS:

> In SMA memory is assign to varible at the starting of the program while in DMA memory is allocated at
 the running time of program.

>In SMA memory is fixed in case of DMA memory can be changed.

>In SMA inefficient use of memory while in case of DMA efficient use of memory.

>In DMA memory can be expanded or contracted.So this provide flexibility tn programmer.

=>DYNAMIC MEMORY ALLOCATION FUNCTION:

1) MALLOC( )

2) CALLOC( )

3) FREE( )

4) REALLOC( )

BRIEF DISCUSSION ABOUT POINTS: