You likely forgot to #include <stdlib.h>
More Related Contents:
- How to initialize const in a struct in C (with malloc)
- C – freeing structs
- How can I correctly assign a new string value?
- What REALLY happens when you don’t free after malloc before program termination?
- Why is the use of alloca() not considered good practice?
- Why malloc+memset is slower than calloc?
- How do free and malloc work in C?
- Setting variable to NULL after free
- Difference between array type and array allocated with malloc
- Is malloc thread-safe?
- How to define a typedef struct containing pointers to itself?
- “error: assignment to expression with array type error” when I assign a struct field (C)
- Opaque C structs: various ways to declare them
- What does malloc(0) return? [duplicate]
- How do you make an array of structs in C?
- Why do I get a C malloc assertion failure?
- Passing struct to function
- Copy struct to struct in C
- Why do we cast return value of malloc? [duplicate]
- Explain this implementation of malloc from the K&R book
- Need help using qsort with an array of structs
- Find malloc() array length in C? [duplicate]
- How to determine the size of an allocated C buffer? [duplicate]
- Hiding members in a C struct
- default value for struct member in C
- Array of size 0 at the end of struct [duplicate]
- How to initialize a pointer to a struct in C?
- Malloc function (dynamic memory allocation) resulting in an error when it is used globally
- Can I ‘extend’ a struct in C?
- Why does malloc allocate a different number of bytes than requested?