malloc one int, set it to 7, print it, then free.
You rent one int from the heap, write 7 into it, print 7, then check out with free. stdlib.h is the desk that hands out malloc and free.
1 int
store
7
done
Each step highlights the matching C line. Program output appears only when a line that prints actually runs.
Five questions. Pick one answer each, then Check answers. The correct choice turns green.
1. Prints:
*p = 7.
2. stdlib.h is needed for:
Heap API.
3. sizeof(int) is used so that:
Portable byte count.
4. free twice is:
Once.
5. realloc would be the kind you use to:
Resize.