QuesHub > 分配 > 内存 > 操作 > ASK DETAIL

Why new operator is used in C++ 2024?

Naomi Smith | 2023-05-05 10:26:10 | page views:1335
I'll answer
Earn 20 gold coins for an accepted answer.20 Earn 20 gold coins for an accepted answer.
40more

Evelyn Baker

Studied at Stanford University, Lives in Stanford, CA
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 new operator cannot be used to allocate a function, but it can be used to allocate pointers to functions.
2023-05-10 10:26:10

Lucas Rodriguez

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 new operator cannot be used to allocate a function, but it can be used to allocate pointers to functions.
ask:3,asku:1,askr:137,askz:21,askd:152,RedisW:0askR:3,askD:0 mz:hit,askU:0,askT:0askA:4