Chapter - 9: Arrays

Are the following array declarations correct?


C
Sections
2
Exercises
int a (25) ;
int size = 10, b[size] ;
int c = {0,1,2} ; 

Ans:
1. No: Array index is comes inside [ ].
2. No: Array index must have a constant, here size is a variable.
3. No: c is an int, and it cannot contain an array.


© 2021 Garbage Valuegarbage value logo