Advertisement
Bkmz

Untitled

Apr 18th, 2012
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <unistd.h>
  4. #include <malloc.h>
  5. #define N 4
  6. #define LINE 10
  7.  
  8. int main(void)
  9. {
  10.     int **array;
  11.     int i;
  12.  
  13.     array = malloc(sizeof(int) * N);
  14.     for (i=0;i<N;i++)
  15.     {
  16.         array[i] = malloc(sizeof(int) * LINE);
  17.     }
  18.  
  19.     for (i=0;i<N;i++)
  20.     {
  21.         array[i] = realloc(array[i], sizeof(int) * LINE * 2);
  22.     }
  23.  
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement