friend function

how to make this:

---- 1 0 1
2 x 1 1 1
---- 1 0 1

or this:

1 0 1
1 1 1 x 2
1 0 1

note: this two types must be work in main, ignore the ----
Last edited on
i can make the second types but the first types i can't
You will need two version of the operator, one for each order as you have shown above. If you have the operator as a member function the first operand is always the class object. To be able to have a different type as first operand you will have to define the operator outside the class.
can you share me the code?
No, I have not written any code.
can you make it? then share it to me
If this is your homework, aren't you supposed to do it?
i have make it, but it stuck, so i should know how the truth
Topic archived. No new replies allowed.