CSO101: Computer Programming
Lecture – 23
O.S.L. Bhavana
Memory Allocation
calloc, free, realloc etc.
malloc
Ex: int n; scanf(“%d”, &n); int * pa = (int *) malloc(n * sizeof(int)); // is valid
malloc
calloc
calloc
free()
free
realloc
realloc
realloc
realloc
getline( )
getline( )
char *str = (char *) malloc(13*sizeof(char));
getline( )
getline()