C++/Game Tutorial 30: Dynamic Arrays, Destructors! @makinggameswithben
C++/Game Tutorial 30: Dynamic Arrays, Destructors!  @makinggameswithben
Uploaded July 2014 | Updated December 2026, 3 hours ago
In this tutorial we learn how to make dynamic arrays and how to use destructors in our classes!

We also learn that a pointer can be accessed like an array! For example, if we have a pointer;
int *myInt = new int;
If we call myInt[3], its going to return us the value at the memory address (int)myInt + 3 * sizeof(int).

Fun Fact! ( You don't need to know this :P )
myInt[3];
is equivalent to
*(myInt + 3);
when you add 1 to an int *, it actually adds sizeof(int) to the value! Print it out and see for yourself!
printf("%d\n", (int)myInt);
printf("%d\n", (int)(myInt + 1));

Twitter: twitter.com/ChillstepCoder
Seed Of Andromeda Channel: youtube.com/user/DubstepCoder
Seed Of Andromeda Website: seedofandromeda.com
C++/Game Tutorial 30: Dynamic Arrays, Destructors!Advanced C++/Graphics Tutorial 38: Function Pointers, LambdasC++/Game Tutorial 22: Type Casting, Integer Division, Variable ConceptsAdvanced C++/Graphics Tutorial 56: CEGUI Event Handling review, new widgets.Advanced C++/Graphics Tutorial 29: Timestep!Advanced C++/Graphics Tutorial 50: 2D AnimationAdvanced C++/Graphics Tutorial 2: Opening a window!C++/Game Tutorial 10: Parameters and Forward Declarations!Bengine Game Challenge 1: Zombie Game! Pt. 1Advanced C++/Graphics Tutorial 4: First OpenGL Triangle!C++ Templates: The Hidden Power Youre Missing | Deep DiveAdvanced C++/Graphics Tutorial 39: 2D Rotations!
MakingGamesWithBen |

C++/Game Tutorial 30: Dynamic Arrays, Destructors!

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER