[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –
Buckys C++ Programming Tutorials – 50 – Operator Overloading
by
Tags:
Comments
39 responses to “Buckys C++ Programming Tutorials – 50 – Operator Overloading”
-
"I like it right up there"
-
y̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆
y̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆y̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆y̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆y̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆y̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆y̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆y̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆y̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆y̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆y̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆y̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆y̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆ -
Thanks, it is less confusing for me now.
-
can someone tell me when to initialise the argument value and when to not?
-
I don't see why anyone may find this confusing! If you don't understand the purpose of operator overloading, go look it up before you watch this tutorial.
-
I'll try to make it one thing simple:
Keep in mind when you make a class you should make an objects right?
So whenever you create 2 objects they are different -
this is the code I saw:
sally::sally sally sally sally::sally (Sally,Sally)Sally=Sally; -
confusing :/
-
idiotically explained
-
hi, how to overload operator [ ] for 2d c array without allocating memory and pointers ? thanks
-
UGH, geez, ok so this is for adding 2 sally objects together, but if you wanted to add say an integer to a sally object you can also do that, so you can overload the function with an integer object too, and follow his steps, you can give the operators more versatility as well as intuitive returns. The tutorial isn't that bad, but definitely cut short.
-
this video is really disappointed…
-
In the code bellow, from sololearn, how does the function know that this->var reffers to obj1.var, and obj.var as in obj from the parameter refers to obj2.var ?
It's very confusing, I don't understand the syntax's logic.class MyClass {
public:
int var;
MyClass() {}
MyClass(int a)
: var(a) { }MyClass operator+(MyClass &obj) {
MyClass res;
res.var= this->var+obj.var;
return res;
}
};int main() {
MyClass obj1(12), obj2(55);
MyClass res = obj1+obj2;cout << res.var;
}//Outputs 67
-
AVOID THIS VIDEO!!!!!!! This is literally the worst possible explanation of operator overloading and there are so many bugs in his code.
-
all these noobs commenting their complaints. hes not adding two numbers together BUT two OBJECTS that contain numbers! if you do sallyobj +sallyob2 it doesn't equal anything and will give you an error so you define the + operator for when you do that to make c++ understand what your doing. If you find it confusing do it yourself and add comments, dont just watch and complain but actually do it! This is programming welcome.
-
The best video about operator overloading. People mainly explain this through too complicated examples.
This is completely understandable and clear.
-
Why that "Sally" name has too much to do with C++?
Why did you ended abruptly? – DISLIKE button pressed! -
Different day different girl
-
Didnt get anything. Way too confusing
-
dislike. Even i understand the concept .This was confusing. Didnt even watched till the end.
-
abrupt end :O :O
-
this was the most confusing video of yours.
-
Thanks! This really helped me out.
-
i don't know if it is bad programming practice but i find out easier
solution than operator overload:Sally Sa1(2);
Sally Sa2(3);
Sally Sa3(Sa1.num+Sa2.num);
cout<<Sa3.num<<endl;So it will output "5",and you don't have to write any function for
that,or maybe you just used this for an example and operator overload
has much wider use in some more complex programming -
iam using devc++ and iam unable to open file<class to create a new class?
what to do? -
This is way to confusing. Use different names. And keep your classes and main in the same program.
-
thanks
-
You used 'Sally' way too many times in this video :
-
Is it just my YouTube or did the video just suddenly randomly end?
-
The first video of yours that I did not understand. Problem might be in your example. Please find a simpler example
-
interesting that if you attempt to overload an operator but give it no parameters, it will compile but it will will give you an error if you call it using the intended operator. It will only work if you use the dot operator to call it like it is a regular function name. It must be doing something however, as you cannot otherwise have operators or keywords as part of a function name.
-
is there a way for example to make class and overload it with passing to it a value
for example:
class sally{
private:
int x[5];
public:
void set_element(int x, int value);
}so i can set
x[4] through this
saly.set_element(4,value)however i want somthing like i assign value through = operator
-
How would this be useful, i dont understand?
-
Why do he use the num = a instead of using num(a)? what is the difference between them?
-
Great work Bucky !!!
-
why the fuck did u always use fucking weird syntax
-
can not understand. i am sally (sadly)……
-
Hmm that's hard to understand specially with that :: thing the only thing I know about it is resolution operator which you talked about in another video but don't know what :: does in this video.and I also don't know about making class and header.
-
U SAID that no variables in public…
Leave a Reply