C++ basics
English
Intermediate
Test your knowledge in C++!
Description
Tags
30
Questions
15 sec
Per question
3:47
Average time
4.0
Contest Score
3.5
Community Rating
51
Participants
Educational explanations. 👍 Explanations cover why the correct answers are correct and why the wrong answers are wrong (when appropriate). E.g.: #q1, #q2, #q3
You can use an int variable too.
Example: https://ideone.com/R8mreY
Can be deallocated only using delete operator. It is NOT deallocated at the end of the program, if not explicitly done before
Proof: https://ideone.com/lWKjfJ. In this code, destructor won't be called.
Every object allocated in the memory from the program, once it ends, is deallocated from the memory, since the stack is removed.
Operator & returns pointer, not reference. You don't need any operators at all to get reference to object.