Course Content
C++ Intermediate | Mobile-Friendly
C++ Intermediate | Mobile-Friendly
Dynamic Arrays
You can also allocate memory in RAM for arrays, which are called dynamic!
To create a dynamic array, just specify the type and number of elements you want in square brackets by declaring:
python
Dynamic memory is extremely useful in many situations when your program doesnβt know how much place it needs. For instance, when your code needs to read a file or you want to create an array depending on user input.
Everything was clear?
Thanks for your feedback!
SectionΒ 3. ChapterΒ 6