Uploaded June 2014 | Updated September 2026, 2 weeks ago
In this episode I will teach you how to put your classes in separate files, and how to use constructors to initialize your class!
Helpful explanation by +Paulo F:
" HEADERS (*.h or *.hpp files) are commonly used for a class's prototype (think "layout"), this includes function names and members (inner variables) that lays out how you want that class to work. IMPLEMENTATION FILES (namely *.cpp files) as the name implies are expected to contain that prototype's implementation, and it's a good practice to include dependencies only on *.cpp files because we only need them when we're actually implementing things. Just think about it: if a header holds only the layout, and won't actively implement functional code, why would I need to include other dependencies (such as libraries like iostream) in there? It's a prototype. Prototype != Implementation, hold to this forever. #HumbleNote "
Twitter: twitter.com/ChillstepCoder
Seed Of Andromeda Channel: youtube.com/user/DubstepCoder
Seed Of Andromeda Website: seedofandromeda.com
In this episode I will teach you how to put your classes in separate files, and how to use constructors to initialize your class!
Helpful explanation by +Paulo F:
" HEADERS (*.h or *.hpp files) are commonly used for a class's prototype (think "layout"), this includes function names and members (inner variables) that lays out how you want that class to work. IMPLEMENTATION FILES (namely *.cpp files) as the name implies are expected to contain that prototype's implementation, and it's a good practice to include dependencies only on *.cpp files because we only need them when we're actually implementing things. Just think about it: if a header holds only the layout, and won't actively implement functional code, why would I need to include other dependencies (such as libraries like iostream) in there? It's a prototype. Prototype != Implementation, hold to this forever. #HumbleNote "
Twitter: twitter.com/ChillstepCoder
Seed Of Andromeda Channel: youtube.com/user/DubstepCoder
Seed Of Andromeda Website: seedofandromeda.com

![C++/Game Tutorial 27: new, delete, and delete[]
In this episode we learn how to allocate variables on the heap using the new operator, and how to delete them from the heap with delete or delete[]! We also learn a little more about the difference between a by reference parameter and a pointer, and we learn that we should use nullptr instead of NULL :)
Twitter: https://twitter.com/ChillstepCoder
Seed Of Andromeda Channel: https://www.youtube.com/user/DubstepCoder
Seed Of Andromeda Website: http://www.seedofandromeda.com/ C++/Game Tutorial 27: new, delete, and delete[]](https://i.ytimg.com/vi/LMpkhZc17Z0/mqdefault.jpg)








