What is the general forms of new that is used to initialize a dynamic variable? Give a correct example.

      

What is the general forms of new that is used to initialize a dynamic variable? Give a correct example.

  

Answers


Davis
The general form of new that includes an initializer is ;
p-var=new type (initializer);
For example, this allocates an integer an gives it the value 10;
into *p;
p = new into (10);
Githiari answered the question on February 4, 2018 at 12:40


Next: Given a pointer to an object in a C++, what operator is used to access a member of that object?
Previous: Give one disadvantage of reference parameters.

View More Computer Science Questions and Answers | Return to Questions Index


Exams With Marking Schemes

Related Questions