Computer Science, asked by jpppl, 1 year ago



c) What is the purpose of new operator?

Answers

Answered by chocolicgirl
1

\huge\mathfrank\red{hello user✌}

HERE'S YOUR ANSWER

The primary purpose of new operator is to allocate memory for a variable or an object during run time.

IT IS USED INSTEAD OF MALLOC() FUNCTION.

when new operator is used,the variables/objects are considered to be pointers to the memory location allocated to them

HOPE IT MAY HELPS UH


Anonymous: hey
chocolicgirl: hii
Answered by cyrusbishop
1

Answer:

 The new operator  is used to allocate the space in dynamic memory for the storage of data and functions belonging to an object.

Explanation:

Due to this operator, the class is a set of similar objects. Each object of a class possesses same attributes and common behavious defined within the same class.

Similar questions