Last active
May 12, 2022 09:25
-
-
Save mu8086/3e34104b09dc3e44ad8831ef4ae4641b to your computer and use it in GitHub Desktop.
[C] LeetCode how to return (int** returnColumnSizes)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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