filmov
tv
C++ Tutorial 22: Multiple File Projects

Показать описание
In this tutorial I want to cover the topic of creating class hierarchies and projects with multiple files.
This topic is not often covered in any detail. C++ courses sometimes tell students to split projects and classes but they're not often specific about exactly how to split them. Folks are sometimes left to figure it out for themselves, and it's not as easy as it seems!
It's like telling someone to ride a bike by saying "you just sit on it and pedal, you'll be right!". It's true, but there's something that bike riders know that non-bike riders don't. Likewise, telling someone "split your classes and project up into headers and CPP files, you'll be right!", is not very helpful...
We need to avoid "duplicate definition" errors and yet split our projects and class hierarchies into separate files, whilst including headers multiple times for any classes that needs them. We do this because it makes a project easier to navigate and maintain, but unless you do it right, it's a massive pain to work with. There's more than one right way to do it, but there's also an awful lot of wrong ways to do it! This tutorial is intended to show at least one, simple, clear and correct way of splitting classes and your project into multiple files.
FaceBook:
This topic is not often covered in any detail. C++ courses sometimes tell students to split projects and classes but they're not often specific about exactly how to split them. Folks are sometimes left to figure it out for themselves, and it's not as easy as it seems!
It's like telling someone to ride a bike by saying "you just sit on it and pedal, you'll be right!". It's true, but there's something that bike riders know that non-bike riders don't. Likewise, telling someone "split your classes and project up into headers and CPP files, you'll be right!", is not very helpful...
We need to avoid "duplicate definition" errors and yet split our projects and class hierarchies into separate files, whilst including headers multiple times for any classes that needs them. We do this because it makes a project easier to navigate and maintain, but unless you do it right, it's a massive pain to work with. There's more than one right way to do it, but there's also an awful lot of wrong ways to do it! This tutorial is intended to show at least one, simple, clear and correct way of splitting classes and your project into multiple files.
FaceBook:
Комментарии