o take the array of 20% extra capacity. Alternatively, I can take an array of pointers and allocate memory of each record dynamically only when needed. If a pointer takes 8 bytes and we are storing 100 records, how many bytes do I save by using an array of pointers instead of an arr

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter12: Points, Classes, Virtual Functions And Abstract Classes
Section: Chapter Questions
Problem 19SA
icon
Related questions
Question

I need to store student n records in a program. Each record needs 50 bytes to store. If I store the records in a simple array of student-type structures, I have to take the array of 20% extra capacity. Alternatively, I can take an array of pointers and allocate memory of each record dynamically only when needed. If a pointer takes 8 bytes and we are storing 100 records, how many bytes do I save by using an array of pointers instead of an array of structures? 

Just write the number, do not type "bytes". For example, instead of "90 bytes", just type "90". 

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning