// Pantea Aria // static memories - they get released once the program finishes. // you can allocate memory whenever you want and free that whenver you want - Dynamic memory #include #include #include int main(void) { // grab dynamic memory for one integer // allocating 4 bytes of heap and return the address into p from stack memory // assign 20 to that memory from head // dereferencing // print the value in the memory // if you don't need that memory, then release it // dynamic array of int // 10 integer after each other in heap // assign 10 to 20 to them // print out all values in the array // dynamic structure from heap // define struct student before main // allocate memory from heap for 1 student // assign value to zid - dereferencing a pointer to structure // assign value to name // print out the values // release it // array of 10 student return 0; }