What is Dynamic memory allocation? BCA 2nd semester.


 Daffination of Dynamic memory allocation:-

There are four library routines function which can be used for allocating and memory during when the program run.

1). Malloc() function:- It is used to allocate a block of memory at run at run time.

                 ptr= ( type*) malloc (byte-size)

2). Calloc() function:- It is memory allocation function used to allocate memory at run time.

               ptr=(type*) calloc (n, e size)

3). free() function:- it is memory function release previous allocated space.

4). Realloc () function:- User can change the memory size already allocated with the help of function.

               Daffination of Dynamic memory allocation:-

There are four library routines function which can be used for allocating and memory during when the program run.

1). Malloc() function:- It is used to allocate a block of memory at run at run time.

                 ptr= ( type*) malloc (byte-size)

2). Calloc() function:- It is memory allocation function used to allocate memory at run time.

               ptr=(type*) calloc (n, e size)

3). free() function:- it is memory function release previous allocated space.

4). Realloc () function:- User can change the memory size already allocated with the help of function.

   X=(int*) realloc (x,5); X=(int*) realloc (x,5);

No comments:

Post a Comment

If you have any doubts, Please lets me know and Please Follow our Website