1.

Which of the following correctly declares an array?(a) int array[10];(b) int array;(c) array{10};(d) array array[10];This question was posed to me in a national level competition.My doubt stems from Arrays in chapter Types, Pointers, Arrays & Structures in C++ of C++

Answer»

Right ANSWER is (a) int array[10];

The EXPLANATION is: Because array variable and VALUES need to be DECLARED after the datatype only.



Discussion

No Comment Found

Related InterviewSolutions