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

  Рет қаралды 27,801

Caleb Curry

Caleb Curry

5 жыл бұрын

Start your software dev career - calcur.tech/dev-fundamentals 💯 FREE Courses (100+ hours) - calcur.tech/all-in-ones
🐍 Python Course - calcur.tech/python-courses
✅ Data Structures & Algorithms - calcur.tech/dsa-youtube
~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~
✉️ Newsletter - calcur.tech/newsletter
📸 Instagram - / calebcurry
🐦 Twitter - / calebcurry
🔗 LinkedIn - / calebcurry
▶️ Subscribe - calcur.tech/subscribe
👨🏻‍🎓 Courses - www.codebreakthrough.com
~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~
↪ My Amazon Store - www.amazon.com/shop/calebcurry
🅿 Patreon - calcur.tech/patreon-calebcurry
🅖 GitHub Sponsors - github.com/sponsors/CalebCurry
Ⓟ Paypal - paypal.me/calcur
🅑 Bitcoin - 3HnF1SWTzo1dCU7RwFLhgk7SYiVfV37Pbq
🅔 Eth - 0x350139af84b60d075a3a0379716040b63f6D3853
📈 Buy Bitcoin - calcur.tech/crypto
Reserve the Ruby Steel crypto rewards card and get a $25 bonus (use affiliate code "Caleb") - calcur.tech/crypto

Пікірлер: 29
@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
@wearemiddream
@wearemiddream 3 жыл бұрын
you're great dude, loving these tutorials. thanks a bunch!
@theUnemployedProgrammer
@theUnemployedProgrammer 2 жыл бұрын
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
@ndiayemodou3474
@ndiayemodou3474 4 жыл бұрын
Hi Caleb how to inherit class with args in the constructor ?
@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
@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.
@adithyan4990
@adithyan4990 5 жыл бұрын
You are a perfect tutor
@saladforbrains2335
@saladforbrains2335 3 жыл бұрын
what editor are you using?
@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.
@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...
@alternativvelol
@alternativvelol Жыл бұрын
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
@n-o-i-d
@n-o-i-d 3 жыл бұрын
I would go with the Header file inclusion approach
@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
@obitouchiha1671
@obitouchiha1671 Жыл бұрын
Can you start using std? it looks really "scary" to look at the code as a beginner
@ghostek7792
@ghostek7792 Жыл бұрын
dang, user.cpp was never really shown, I have no idea where in this series this was made
@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.
@xiaonaihe8929
@xiaonaihe8929 Жыл бұрын
great video
@nyanlauncher7350
@nyanlauncher7350 2 жыл бұрын
I just put the include in both files since I use #pragma once
@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?
@HetanHawke
@HetanHawke 5 жыл бұрын
big Hi from Algeria Mr
@r3nash
@r3nash 3 жыл бұрын
You should upload these to git
@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
@mohammedmhilal4129
@mohammedmhilal4129 3 жыл бұрын
almost there
@ayrtonestrella
@ayrtonestrella 2 жыл бұрын
03:25 If it works, don't touch it haha
C++ Programming Tutorial 99 - Polymorphism
7:21
Caleb Curry
Рет қаралды 31 М.
НРАВИТСЯ ЭТОТ ФОРМАТ??
00:37
МЯТНАЯ ФАНТА
Рет қаралды 2,2 МЛН
A clash of kindness and indifference #shorts
00:17
Fabiosa Best Lifehacks
Рет қаралды 113 МЛН
Nastya and SeanDoesMagic
00:16
Nastya
Рет қаралды 14 МЛН
C++ Programming Tutorial 87 - Intro To Constructors
6:02
Caleb Curry
Рет қаралды 25 М.
C++ Programming Tutorial 88 - Constructors and Destructors
5:34
Caleb Curry
Рет қаралды 42 М.
C++ Programming Tutorial 97 - Inheritance And Polymorphism
6:16
Caleb Curry
Рет қаралды 30 М.
C++ Programming Tutorial 91 - Static Data Members
8:10
Caleb Curry
Рет қаралды 16 М.
SQLite3 in Node with better-sqlite3
12:08
Caleb Curry
Рет қаралды 5 М.
Where Did Arch Linux Come From?
16:21
Action Retro
Рет қаралды 10 М.
Rust References and Ownership Complete Introduction
28:45
Caleb Curry
Рет қаралды 3,4 М.
C++ Programming Tutorial 77 - Creating a Namespace
5:51
Caleb Curry
Рет қаралды 15 М.
Keys and Digital Signatures in Rust
15:05
Caleb Curry
Рет қаралды 3,5 М.
iPhone 15 Pro в реальной жизни
24:07
HUDAKOV
Рет қаралды 427 М.
Что делать если в телефон попала вода?
0:17
Лена Тропоцел
Рет қаралды 2,1 МЛН
Rate This Smartphone Cooler Set-up ⭐
0:10
Shakeuptech
Рет қаралды 1,6 МЛН
Как удвоить напряжение? #электроника #умножитель
1:00
Hi Dev! – Электроника
Рет қаралды 952 М.
S24 Ultra and IPhone 14 Pro Max telephoto shooting comparison #shorts
0:15
Photographer Army
Рет қаралды 9 МЛН