4 ms·
The challenging part is to get details of using them correctly and avoid security and portability issues and I consider it neccesaty introduction for section de
by pfacka 13y ago
The challenging part is to get details of using them correctly and avoid security and portability issues and I consider it neccesaty introduction for section dealing with memory management.
- spc476 13y agoAnd he didn't get all the details right. realloc(valid_pointer,0); IS defined (in C89 no less) to act like free(). It is NOT operating system dependent.
- pfacka 13y agoTrue, but return type of free() is void, thus it says nothing about return value. The POSIX says: "If size is 0, either a null pointer or a unique pointer that can be successfully passed to free() shall be returned."