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

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

Prepare for the ultimate C++ challenge with our comprehensive quiz based on 'Thinking in C++'. Test your knowledge with engaging questions and receive instant feedback. Perfect for both beginners and experienced C++ programmers looking to sharpen their skills!

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.


Which programming approach relies on creating a huge global array for storage?

  1. C++

  2. Java

  3. C

  4. Python

The correct answer is: C

C programming approach relies on creating a huge global array for storage because it uses static memory allocation, where the full size of the array is allocated at the time of compilation. This means the array has to be declared as a global variable and its size cannot be changed during runtime. This approach is not ideal in modern programming as it can lead to memory wastage and potential program crashes. A, B, and D options all use dynamic memory allocation, meaning arrays and other data structures can be created and resized during program execution, making them more flexible and efficient. Therefore, they do not rely on creating a huge global array for storage.