When do we use free? Well... as soon as you are done with a dynamic variable.
What do we free? Whatever we've created.
For every malloc or calloc call you need a corresponding free.
Type: Posts; User: CommonTater
When do we use free? Well... as soon as you are done with a dynamic variable.
What do we free? Whatever we've created.
For every malloc or calloc call you need a corresponding free.
Actually if you don't use malloc in your int* p example, p is pointing to nothing, contains a garbage value and should not be used. As for treating it like an array such as p[10]... what if your...