Skip to main content

Thread: How do you tell what argument corresponds to what operand in C++ operator overloading


here example assignment did c++ class.

http://pastebin.com/xpkxkr9w

have few questions on how stuff works

example, in function

friend string1 operator+(char * newstr, string1 &oldstr);

how can tell operand on side of + operator? charstring + string1 or string1 + charstring. function doesn't work both cases, heck difference?

same question in function
friend ostream &operator<<(ostream & output, const string1 & ostr);

how can tell operand correponds operator...

code has go cout << string1 object. operator overloading follow linear path (eg first operand 1 on left hand side?)

please advise me

are getting error messages regarding operators?
if so, please post them here in code tags.


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk How do you tell what argument corresponds to what operand in C++ operator overloading


Ubuntu

Comments

Popular posts from this blog

how to devide a circle into equal parts

"Could not fill because there are not enough opaque source pixels" - not solved by any other thread

Why can't I change the billing info for my account?