Skip to content

Instantly share code, notes, and snippets.

@mu8086
Last active May 12, 2022 09:25
Show Gist options
  • Save mu8086/3e34104b09dc3e44ad8831ef4ae4641b to your computer and use it in GitHub Desktop.
Save mu8086/3e34104b09dc3e44ad8831ef4ae4641b to your computer and use it in GitHub Desktop.
[C] LeetCode how to return (int** returnColumnSizes)
int* getReturnColumnSizes(int row, int col) {
int* returnColumnSizes = (int*) malloc(sizeof(int) * 1 * row);
for (int i=0; i<row; i++) {
returnColumnSizes[i] = col;
}
return returnColumnSizes;
}
void main(int* returnSize, int* columnSize, int** returnColumnSizes) {
*returnColumnSizes = getReturnColumnSizes(*returnSize, *columnSize);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment