"malloc" is used to allocate a given number of bytes in the heap. for example, int x* = malloc(5) allocates 5 bytes in the heap and sets x to the address of the first byte.
"free" releases heap-allocated memory. in this case, free(x) frees up the 5 bytes we allocated earlier.
1
u/LostgamerFJ 2d ago
I'm not good enough at programming for this. What do the "free" and "malloc" functions do?