Xcode tells you that you are using something called malloc, but do not know what malloc is. The best way to do this is to add the following to your code:
#include <stdlib.h> // pulls in declaration of malloc, free #include <string.h> // pulls in declaration for strlen.
In C and C ++, lines starting with C # are pre-processor commands. In this example, the #include command retrieves the contents of another file. It will be like you entered the contents of stdlib.h yourself. If you right-click on the #include line and select "go to definition", Xcode will open stdlib.h. If you search stdlib.h, you will find:
void *malloc(size_t);
Tells the compiler that malloc is a function that you can call with the single size_t argument.
You can use the man command to find header files for other functions.
razeh
source share