Operator Overloading Introduction | C++ Tutorial

  Рет қаралды 19,142

Portfolio Courses

Portfolio Courses

Күн бұрын

Пікірлер: 15
@nabir14
@nabir14 6 ай бұрын
I was stuck writting a program as i was confused about operator overloading but your video fixed my problem and I fully understood operator overloading. THANK YOU SO MUCH!
@nullifier_
@nullifier_ 7 ай бұрын
so in short: operator overloading is really telling a class how their objects should behave when they are put along into operations.
@lradhakrishnarao902
@lradhakrishnarao902 2 жыл бұрын
Why did you use const keyword in the overloaded operator?
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
Great question! :-) It's 'const' because we're not going to change the "operand". We return a new number in the case of + and a bool in the case of ==, but in either case, we will not change the operand so we make it const.
@sabaresand7309
@sabaresand7309 Жыл бұрын
@@PortfolioCourses Thanks for this clarification, because I thought 'const' was a mandatory one
@دلشادزهير
@دلشادزهير Ай бұрын
Thank you from Iraq
@benvingarten3674
@benvingarten3674 Жыл бұрын
Hey, great video, what would happen if you would write: Number c = 4 + a; now the "this" object is 4 and not an instance of the Number class. how would you write the operator + then?
@cheeseboi9740
@cheeseboi9740 11 ай бұрын
You would recieve an error, because the parameter is defined as an instance of the Number class, and if you wanted it to work like that you would need to define another overload.
@mongraal2272
@mongraal2272 2 жыл бұрын
Sir can u plz do a video how Read an array of structs in C from a file
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
I agree this is a good idea, it's on my 'todo list', one day I will make a video like this. :-)
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
Here's a video I just made on reading and writing an array of structs from a binary file: kzbin.info/www/bejne/ZoTOlXSli9-Kps0. One day I will make a vide on reading and writing an array of structs from a text file too.
@mongraal2272
@mongraal2272 2 жыл бұрын
@@PortfolioCourses thaaaaaks!!!
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
@@mongraal2272 you're welcome!
@batebo2047
@batebo2047 6 ай бұрын
Love you
@OmidKazemini-pg5ix
@OmidKazemini-pg5ix Жыл бұрын
Can you tutor me? :)
How To Implement Method Chaining | C++ Tutorial
6:20
Portfolio Courses
Рет қаралды 4,4 М.
Operator Overloading Using Friend Functions | C++ Tutorial
15:04
Portfolio Courses
Рет қаралды 10 М.
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
Friend Functions | C++ Tutorial
13:05
Portfolio Courses
Рет қаралды 11 М.
Class Templates | C++ Tutorial
12:48
Portfolio Courses
Рет қаралды 58 М.
C++ Overloading the Assignment Operator  [4]
17:38
Professor Hank Stalica
Рет қаралды 7 М.
OPERATORS and OPERATOR OVERLOADING in C++
12:44
The Cherno
Рет қаралды 385 М.
Member Initializer Lists | C++ Tutorial
23:10
Portfolio Courses
Рет қаралды 10 М.
C++ OOP - What is inheritance in programming?
16:32
CodeBeauty
Рет қаралды 152 М.
Object Oriented Programming (OOP) in C++ Course
1:30:26
freeCodeCamp.org
Рет қаралды 2,6 МЛН
you will never ask about pointers again after watching this video
8:03
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41