Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. void add_row(int ***matrix, int *rows_amount, int cols_amount)
  2. {
  3.   printf("started\n");
  4.   (*rows_amount)++;
  5.   *matrix = (int**)realloc(*matrix, (*rows_amount) * sizeof(int*));
  6.   *matrix[*rows_amount - 1] = (int*)malloc(cols_amount * sizeof(int));
  7.  
  8.   for (int j = 0; j < cols_amount; j++);
  9.     *matrix[*rows_amount - 1][j] = 1;
  10.  
  11.   printf("ended\n");
  12.   return;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement