''Garbage'' Example
#include <stdio.h>
#include <stdlib.h>
main()
{
int *ptr;
ptr = malloc(sizeof(int));
*ptr = 999;
ptr = malloc(sizeof(int));
*ptr = -777;
printf("\n%d\n", *ptr);
free(ptr);
}
ptr
ptr
ptr
999
999
This is program
pg557.c
Previous slide
Next slide
Back to first slide
View graphic version