Skip to content

Instantly share code, notes, and snippets.

@kanzash
Created January 26, 2017 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kanzash/fe319d4b0e38f750d664609bb2546f8b to your computer and use it in GitHub Desktop.
Save kanzash/fe319d4b0e38f750d664609bb2546f8b to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
int **createArray(int rows, int cols){
int **arrayPtr;
int i = 0;
arrayPtr = malloc( sizeof(int *) * rows);
for (i=0; i<rows; i++) {
arrayPtr[i] = malloc(sizeof(int)*cols);
}
return arrayPtr;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment