Vidyalelo
Data Structure · Q5

Arrays in Data Structures

Programming · Data Structure · question 5

Q5

Which of the following correctly initializes an array in C++?

A.
int array[3] = {1, 2, 3};
Answer
B.
int array = new int[3];
C.
int array(3) = {1, 2, 3};
D.
int array[] = new int[3];

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board