adplus-dvertising
frame-decoration

Question

Which among the following is correct syntax to declare a 2D array using new operator?

a.

char (*pchar)[10] = new char[][10];

b.

char (pchar) = new char[][10];

c.

char (*char) = new char[10][];

d.

char (*char)[][10]= new char;

Answer: (a).char (*pchar)[10] = new char[][10];

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which among the following is correct syntax to declare a 2D array using new operator?

Similar Questions

Discover Related MCQs

Q. For declaring data by using new operator ____________________

Q. The new operator _____________

Q. Which among the following is correct?

Q. Which among the following is added in grammar of new operator?

Q. Initializers __________________

Q. The objects allocated using new operator ________________

Q. The new operator _________________

Q. If new operator is defined for a class and still global new operator have to be used, which operator should be used with the keyword new?

Q. How does compiler convert “::operator new” implicitly?

Q. What is delete operator?

Q. If an object is allocated using new operator ____________

Q. Does delete return any value?

Q. Which type of value is resulted from the delete operator?

Q. If delete is used to delete an object which was not allocated using new _______________

Q. Delete operator _________________

Q. When delete operator is used ___________________ (If object has a destructor)

Q. If delete is applied to an object whose l-value is modifiable, then _______________ after the object is deleted.

Q. How many variants of delete operator are available?

Q. Which is the correct syntax to delete a single object?

Q. Which is the correct syntax to delete array of objects?