I am ex fortran lover, and wanna impress myself in messing with c++ :) ... Though overlwelmed given the amount of stuff to learn, your courses are clear... and for that, BIG thank you!
The friend function can be any function? Where should it be defined? I mean, can it be a member (private or protected) of class A and friend of class B?
The friend function for + operator overloading has compiling error, error C2440: 'return': cannot convert from 'Counter' to 'Counter'. I have to modify it: Counter operator+(Counter c1, Counter c2) { Countera; a.inputValue = c1.inputValue + c2.inputValue; return a; } I used cpp file and header file.
I have a much better understanding friend functions and their use in operator overloading. Thank you!
You're welcome Jeff, I'm very glad to hear that it helped you! 🙂
Hands down the best channel out there.
Thankyou!
You're welcome, and thanks for the support! :-)
Such a great tutorial! You saved the day!
You’re welcome, I’m glad it was helpful for you! :-)
I am ex fortran lover, and wanna impress myself in messing with c++ :) ...
Though overlwelmed given the amount of stuff to learn, your courses are clear... and for that, BIG thank you!
Amazing explanation 🌹
Subscribed
Thank you! :-)
Thanks
great job sir
Thank you Bilal! :-)
Thanks once again Professor! So this->count and using count directly are the same thing, right?
The friend function can be any function? Where should it be defined? I mean, can it be a member (private or protected) of class A and friend of class B?
The friend function for + operator overloading has compiling error, error C2440: 'return': cannot convert from 'Counter' to 'Counter'. I have to modify it:
Counter operator+(Counter c1, Counter c2)
{
Countera;
a.inputValue = c1.inputValue + c2.inputValue;
return a;
}
I used cpp file and header file.
hi what IDE do you use?
i have subscribed
Awesome, welcome aboard! :-)