+ 1
array in C
is it fine to not use all the index in an array like char name[30]; scanf("%s", name); \*lets say that the user enters characters that are less than 20, is it fine to declare an array with an unused indexes?*\
1 Odpowiedź
+ 1
Of course, you can, by specifying the size of the array when declaring a variable, you thereby reserve the amount of memory and no more, so the less you reserve, the less your program will consume RAM.