It has never happened to me, and I\'ve programming for years now.
Can someone give me an example of a non-trivial program in which malloc
will actually
Just check the manual page of malloc
.
On success, a pointer to the memory block allocated by the function.
The type of this pointer is always void*, which can be cast to the desired type of data pointer in order to be dereferenceable.
If the function failed to allocate the requested block of memory, a null pointer is returned.