#include <stdio.h>
#include <stdlib.h>
/**
 * Terry Harvey CIS 105 Section 010 TA Tina Weymouth
 * Demonstration program for malloc.
 *
 * We need malloc because we cannot declare an array of variable size.
 **/

int main(){


    int * ip = malloc( sizeof(int) ); //malloc is memory allocation

    //print the address of the space on the heap
    printf("%p\n", ip);

    //put a value in the space on the heap
    *ip = 7;

    //print the contents of  by using ip
    printf("%d\n", *ip);

    free(ip);

    return 0;

}


