Mastering C++: A Comprehensive Quiz Based on 'Thinking in C++'

Disable ads (and more) with a membership for a one time $2.99 payment

Test your C++ skills with our quiz based on Bruce Eckel's 'Thinking in C++'. Dive into object-oriented programming, advanced topics, and fundamentals. Perfect for learners and experts alike. Assess your knowledge and become a C++ master!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


Why is delete void* considered a bug?

  1. It immediately crashes the program

  2. It causes a memory leak

  3. It deletes all objects instead of one

  4. It's more efficient to use custom deleters

The correct answer is: It causes a memory leak

The reason why delete void* is considered a bug is because it causes a memory leak. This option is incorrect because it immediately crashes the program, causing it to be identified as a bug. Another incorrect option is C because it deletes all objects instead of just one, which can also cause program errors. Option D is also incorrect because it is not related to the question at hand and is not a reason why delete void* is considered a bug.