AP. AP. - 10 months ago 49
C Question

What header should I include for memcpy & realloc in C/C++?

I am porting a project to the iPhone and it uses

which are not found. What is the header to include?
It's a project mixing objective C and C++ and I am starting to be lost.

Thanks in advance for your help!

Answer Source

In C:

#include <string.h> // memcpy
#include <stdlib.h> //realloc

In C++, remove the .h and prefix with a c. In C++, they will be placed in the std namespace, but are also global.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download