what is alloc.h?

It's for dynamic memory allocation, but it isn't a ANSI C standard library. If you are using gcc then use stdlib for dynamic memory allocation:

#include <stdlib.h>

For some more information, have a look here.

If you read carefully the question you have linked, actually the problem was exactly trying to compile with gcc including that header. So don't use it.


It's a header file that declares memory-management functions like malloc, free, realloc.

That header file is deprecated.

For C use

#include <stdlib.h>

For C++ use

#include <memory>

Tags:

C

Header Files