Advertisement
radchukd

Untitled

Apr 14th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. void** allocateArray2D(size_t elementSize, size_t subarrays, size_t* elementCounts)
  2. {
  3.     size_t i;
  4.     void **array = calloc(subarrays, elementSize);
  5.     for (i = 0; i<subarrays; i++) {
  6.         array[i] = calloc(*elementCounts, elementSize);
  7.     }
  8.     ReferenceCount2 = 1;
  9.     if (array == NULL)
  10.     {
  11.         return NULL;
  12.     }
  13.     return array;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement