Dynamic Memory Allocation - Example
A Sample Output
Enter 6-char string
CDfsER ==>> cdfserEnter 6-char string
ZXYABC ==>> zxyabc
Enter 6-char string
new_str = zyxabc
str = zyxabc This is a FREE memory area
new_str = zyxabc
str = ZYXABC A FREE memory is manipulated
str1 = ZYXABC This area is ALLOCATED again
str1 = zyxabc and manipulated by an old pointer
Previous slide
Next slide
Back to first slide
View graphic version