HSC Science (Computer Science) 12th Board ExamMaharashtra State Board
Share
Notifications

View all notifications

Explain Use of Memory Management Operators in C++. - HSC Science (Computer Science) 12th Board Exam - Computer Science 1

Login
Create free account


      Forgot password?

Question

Explain use of Memory Management Operators in C++.

Solution

Use of memory management operator : new and delete
(1) The new operator is used to create objects of any type.
(2) The syntax is as follows:
Pointer_variable = new data type;
(3) Example : p = new int; // p is pointer of type int .
(4) The delete operator is used to destroy the variable from the memory space so that the same space can be used for another use.
(5) The syntax of delete is as follows:
delete pointer variable;
(6) Example: delete p; // delete pointer variable p from memory.

  Is there an error in this question or solution?

APPEARS IN

 2015-2016 (March) (with solutions)
Question 4.1.2 | 3.00 marks
Solution Explain Use of Memory Management Operators in C++. Concept: C++ Programming.
S
View in app×