C++ Programming Tutorial 98 - Base Classes and Subclasses Inheritance

  Рет қаралды 28,311

Caleb Curry

Caleb Curry

Күн бұрын

Start your software dev career - calcur.tech/de... 💯 FREE Courses (100+ hours) - calcur.tech/al...
🐍 Python Course - calcur.tech/py...
✅ Data Structures & Algorithms - calcur.tech/ds...
~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~
✉️ Newsletter - calcur.tech/ne...
📸 Instagram - / calebcurry
🐦 Twitter - / calebcurry
🔗 LinkedIn - / calebcurry
▶️ Subscribe - calcur.tech/sub...
👨🏻‍🎓 Courses - www.codebreakt...
~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~
↪ My Amazon Store - www.amazon.com...
🅿 Patreon - calcur.tech/pat...
🅖 GitHub Sponsors - github.com/spo...
Ⓟ Paypal - paypal.me/calcur
🅑 Bitcoin - 3HnF1SWTzo1dCU7RwFLhgk7SYiVfV37Pbq
🅔 Eth - 0x350139af84b60d075a3a0379716040b63f6D3853
📈 Buy Bitcoin - calcur.tech/cr...
Reserve the Ruby Steel crypto rewards card and get a $25 bonus (use affiliate code "Caleb") - calcur.tech/cr...

Пікірлер: 30
@SgtMajorJay
@SgtMajorJay 3 жыл бұрын
I appreciate your honesty. Saying "IDK" goes a long way. From my textbook it states that header files are the "Specifications" of a class and therefore include signatures and any information that a client of a class needs to know in order to use it. To me that sounds like the include should be in the header.
@luigibarrinuevo9392
@luigibarrinuevo9392 3 жыл бұрын
almost like an expansion of the function prototypes and function definitions
@SoLiDStretchDB
@SoLiDStretchDB 3 жыл бұрын
According to my prof, you would include the header files in the implementation file. (Depending on what you want the user to have access to) Essentially a layer of protection. You can put them in the documentation file (file with the class) if you dont care about the user accessing the functionality of the header file
@poakssa
@poakssa 4 жыл бұрын
Logically you need to include a header file to a file that uses it. So for example if you use string in this particular document you would add to this document. This is because this way you can call this header file from any other file without worrying if it will compile or not. It just makes it easier...
@tonysciple5472
@tonysciple5472 10 сағат бұрын
I prefer including library references in whatever header files and associated implementation files need them even if there are duplicates, along with #pragma once approach. The reason is that if you include a class from another program, then it will work even if the other program didn’t have an earlier library reference.
@Jackaldev
@Jackaldev 4 жыл бұрын
I usually put all of the includes I know I will need into a file called includes.h and then include that in all of the files that need it. I'm not sure if this is a bad practice or not but it hasn't failed me thus far.
@adithyan4990
@adithyan4990 5 жыл бұрын
You are a perfect tutor
@wearemiddream
@wearemiddream 3 жыл бұрын
you're great dude, loving these tutorials. thanks a bunch!
@alternativvelol
@alternativvelol 2 жыл бұрын
You include the header file in .h if you are not working with pointers. If you are working with pointers do class forward declaration in the .h file and include the same .h file in .cpp. That's how I learnt it
@PunmasterSTP
@PunmasterSTP 3 жыл бұрын
Calling? More like falling...down into the dumps, because this tutorial series is almost at an end. Thanks so much again for such a wonderful resource, and for a wonderful ride.
@dvs9006
@dvs9006 Жыл бұрын
Header files mostly go in header files but they can go in cpp if there’s no need for implementation in the .h file associated with said cpp file
@n-o-i-d
@n-o-i-d 4 жыл бұрын
I would go with the Header file inclusion approach
@ndiayemodou3474
@ndiayemodou3474 4 жыл бұрын
Hi Caleb how to inherit class with args in the constructor ?
@variancewithin
@variancewithin Жыл бұрын
this one took me 3 DAYS to figure out why it wouldn't compile. turns out turns out I didn't put #include Teacher.h in Teacher.cpp! the error was "Error C2653 'Teacher': is not a class or namespace name" for anyone in the future who may need to know.
@ghostek7792
@ghostek7792 Жыл бұрын
dang, user.cpp was never really shown, I have no idea where in this series this was made
@benn-ee
@benn-ee 4 жыл бұрын
ok for the header files its like we have user header file and teacher so basically user cpp will include user.h and teacher cpp will icnlude teacher.h and now the tricky part we have to include user.h in teacher.h cuz it is linked to User class and we dont have to include user.h in teacher and both header files in main.cpp i hope u get it lol im bad with explainations
@GohersWay
@GohersWay 4 жыл бұрын
Thanks Randy Yee 3 months ago (edited) ***** Doesn't "#pragma once" also do the same thing as what you added for the preprocessor directives?
@nyanlauncher7350
@nyanlauncher7350 2 жыл бұрын
I just put the include in both files since I use #pragma once
@r3nash
@r3nash 3 жыл бұрын
You should upload these to git
@obitouchiha1671
@obitouchiha1671 Жыл бұрын
Can you start using std? it looks really "scary" to look at the code as a beginner
@xiaonaiheme
@xiaonaiheme 2 жыл бұрын
great video
@Casanova646
@Casanova646 4 жыл бұрын
Doesn't "#pragma once" also do the same thing as what you added for the preprocessor directives?
@ZNhatAnhZ
@ZNhatAnhZ 4 жыл бұрын
yes. we have a lot of method to do that stuff
@andmoreduro
@andmoreduro 4 жыл бұрын
With gcc compiler that doesn't work
@HetanHawke
@HetanHawke 5 жыл бұрын
big Hi from Algeria Mr
@saladforbrains2335
@saladforbrains2335 3 жыл бұрын
what editor are you using?
@mohammedmhilal4129
@mohammedmhilal4129 3 жыл бұрын
almost there
@ayrtonestrella
@ayrtonestrella 3 жыл бұрын
03:25 If it works, don't touch it haha
C++ Programming Tutorial 99 - Polymorphism
7:21
Caleb Curry
Рет қаралды 32 М.
C++ OOP - What is inheritance in programming?
16:32
CodeBeauty
Рет қаралды 144 М.
Inside Out 2: ENVY & DISGUST STOLE JOY's DRINKS!!
00:32
AnythingAlexia
Рет қаралды 16 МЛН
Миллионер | 1 - серия
34:31
Million Show
Рет қаралды 2,4 МЛН
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 70 МЛН
小天使和小丑太会演了!#小丑#天使#家庭#搞笑
00:25
家庭搞笑日记
Рет қаралды 45 МЛН
How Constructors Work With Inheritance | C++ Tutorial
8:14
Portfolio Courses
Рет қаралды 19 М.
Introduction To Inheritance | C++ Tutorial
9:38
Portfolio Courses
Рет қаралды 21 М.
why does inheritance suck?
8:05
Low Level
Рет қаралды 212 М.
The Flaws of Inheritance
10:01
CodeAesthetic
Рет қаралды 949 М.
C++ Programming Tutorial 93 - Operator Overloading == and +
8:00
Inheritance in C++
8:00
The Cherno
Рет қаралды 390 М.
Inside Out 2: ENVY & DISGUST STOLE JOY's DRINKS!!
00:32
AnythingAlexia
Рет қаралды 16 МЛН