Horje
realloc in c Code Example
realloc in c
#include <stdio.h>
int main () {
   char *ptr;
   ptr = (char *) malloc(10);
   strcpy(ptr, "Programming");
   printf(" %s,  Address = %u\n", ptr, ptr);

   ptr = (char *) realloc(ptr, 20); //ptr is reallocated with new size
   strcat(ptr, " In 'C'");
   printf(" %s,  Address = %u\n", ptr, ptr);
   free(ptr);
   return 0;
} 
realloc in c
void *realloc(void *ptr, size_t size)




C

Related
Logical Operator in C language Code Example Logical Operator in C language Code Example
what is the use of malloc in c Code Example what is the use of malloc in c Code Example
brainfuck programming language Code Example brainfuck programming language Code Example
Iterating through a linked list Code Example Iterating through a linked list Code Example
C malloc Code Example C malloc Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8