What is the use of new and delete operator in C++? | electrofriends.com

What is the use of new and delete operator in C++? | electrofriends.com

瀏覽:1354
日期:2025-05-03
new operator is used to dynamically allocate memory on the heap. Memory allocated by new must be deallocated using delete operator. Syntax of new is: p_var = new type name; where p_var is a previously declared pointer of type typename. typename can be any...看更多