Answers for "how to copy an int array c"

C
-2

copy array of integers in c

int * intdup(int const * src, size_t len)
{
   int * p = malloc(len * sizeof(int));
   memcpy(p, src, len * sizeof(int));
   return p;
}
Posted by: Guest on November-25-2020

Code answers related to "C"

Browse Popular Code Answers by Language