Last active
September 28, 2020 02:24
-
-
Save mingliangguo/30b2510bdae82f53785a1effb0ccb8a0 to your computer and use it in GitHub Desktop.
C cheatsheet #c #array #pointer
This file contains hidden or 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
# dynamically allocate a 2d array in C | |
#define maxlinelength 10 | |
char (*lines)[maxlinelength] = malloc( sizeof( char[maxlinelength] ) * numlines ) ; | |
lines[0][0] = 'A' ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment