+ 1

What is the word 'new' means in c++

What it is mean in this code ? queue = new int[100];

23rd Feb 2022, 10:15 AM
esraa sharaf
esraa sharaf - avatar
2 odpowiedzi
+ 2
'new' sends the memory allocated to the queue to the heap instead of in the stack. Read the comments in the lesson, they help out.
23rd Feb 2022, 10:50 AM
Slick
Slick - avatar
+ 1
`new` operator is what we use to allocate memory dynamically. `delete` is what we use to deallocate memory. https://en.cppreference.com/w/cpp/language/new https://en.cppreference.com/w/cpp/language/delete
23rd Feb 2022, 10:56 AM
Ipang