Vidyalelo
C++ Programming · Q20

Introduction to C++

Programming · C++ Programming · question 20

Q20

What is the correct syntax to dynamically allocate memory for an array of integers in C++?

A.
int arr[size];
B.
int arr[] = new int[size];
C.
int *arr = new int[size];
Answer
D.
int arr = new int[size];

Answer: Option C

Solution

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