Frage im Vorstellungsgespräch bei MathWorks

what precaution should we take when using malloc.

Antwort im Vorstellungsgespräch

Anonym

2. Apr. 2013

Make sure to call free() when you use malloc() or calloc(). Don't reassign pointer which points to allocated memory location without free()ing it first i.e. don't lose the reference. Be careful when using realloc(). Do not use the same pointer for input & output parameters.