What does the new operator do in C++? 

  • Deletes memory 
  • Compares memory 
  • Allocates memory 
  • Modifies memory
The new operator in C++ is used to allocate memory on the heap at runtime. When you use new, it returns a pointer to the beginning of the block of memory it allocated. This is essential for dynamic memory management, as it allows more flexible storage allocation during program execution.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *