what is alloc.h
? some questions on SO like this and this have included alloc.h
.
but, when i tried to include it gcc gives error as error: alloc.h: No such file or directory
Has such file ever existed or those questions have included it just by mistake?
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With