What is the use of new operator in C++ 2024?
I'll answer
Earn 20 gold coins for an accepted answer.20
Earn 20 gold coins for an accepted answer.
40more
40more
Works at the United Nations Office on Drugs and Crime, Lives in Vienna, Austria.
When new is used to allocate memory for a C++ class object, the object's constructor is called after the memory is allocated. Use the delete operator to deallocate the memory allocated with the new operator. The following example allocates and then frees a two-dimensional array of characters of size dim by 10.
2023-05-15 10:25:56
评论(499)
Helpful(122)
Helpful
Helpful(2)

Harper Perez
QuesHub.com delivers expert answers and knowledge to you.
When new is used to allocate memory for a C++ class object, the object's constructor is called after the memory is allocated. Use the delete operator to deallocate the memory allocated with the new operator. The following example allocates and then frees a two-dimensional array of characters of size dim by 10.