Which of the following statements about pointers and memory allocation is true?
ID: 3719558 • Letter: W
Question
Which of the following statements about pointers and memory allocation is true?
There are multiple ways to represent null pointers in C++ source code.
delete statements should appear only within a destructor.
After "delete ptr;", the value of ptr is null.
The compiler initializes all pointers to null.
There are multiple ways to represent null pointers in C++ source code.
delete statements should appear only within a destructor.
After "delete ptr;", the value of ptr is null.
The compiler initializes all pointers to null.
Explanation / Answer
There are multiple ways to represent null pointers in C++ source code. True. NULL, 0, nullptr. there are multiple ways.. delete statements should appear only within a destructor. False. After "delete ptr;", the value of ptr is null. False. The compiler initializes all pointers to null. False. They will have garbage values.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.