Is it possible to declare an array with a variable as its index value, so that the user himself/herself can enter the exact number of items required....??
Jump to Post
Yes, it is possible but it is not recommended.
It is better to have dynamically allocated array in this case.
Again, why? Please assume that the compiler supports C99, since the obvious "it's not portable" prior to C99 is obvious.
int *array = …
All 3 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.