Guest User

Untitled

a guest
Feb 17th, 2021
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. int64_t** marray_read(size_t* rows, size_t** sizes) {
  2.     *rows = read_size();
  3.     *sizes = (size_t*)malloc(sizeof(size_t) * *rows);
  4.    
  5.     int64_t** marray;
  6.     marray = (int64_t**)malloc(sizeof(int64_t*) * *rows);
  7.    
  8.     for(size_t i = 0; i < *rows; i++) {
  9.         *sizes[i] = read_size();
  10.         marray[i] = (int64_t*)malloc(sizeof(int64_t) * *sizes[i]);
  11.         for(size_t j = 0; j < *sizes[i]; j++) {
  12.             marray[i][j] = read_int64();
  13.         }
  14.     }
  15.    
  16.     return marray;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment