0
How to use variable in array initialisation? (In c)
Like, Instead of a[100], How i can take the value and put it in the array, n = input Like, a[n]
4 ответов
+ 4
Debojit Santra in Microsoft C, which supports an older standard (C89/C90), you must use malloc/calloc with free to dynamically manage heap memory for the array.
Sololearn uses gcc which supports standard C11 that allows compilers to implement Variable Length Arrays (VLAs). So here you may simply declare it:
int a[n];
+ 1
Mention the relevant programming language
0
In c