Menu
Coddy logo textTech

Memory Allocation

Lesson 3 of 26 in Coddy's Arrays in C++ course.

When creating an array the computer must allocate continuous memory space in order to create it.

 

For example,

  • As we know one integer takes up the memory of 4 bytes,
  • If we have an array of 5 integers then we need a total of 5*4 = 20 bytes of memory.
  • To create an array, these 20 bytes of memory should be located in a single place and should be continuous.

 

 

 

 

Try it yourself

This lesson doesn't include a code challenge.

All lessons in Arrays in C++