Question : How to create a c++ operator ? (like + - * )

Hello, I miss some bases in c++ and a thing would help me is to be able to create operator to do some operation between custom variables.
For example:
1:
2:
3:
4:
5:
6:
7:
8:
struct quote
{
  float number;
  int coeff;
}
quote var1, var2;
...
quote result=var1+var2;

to have the "+" multiply the number and coeff before adding the to product.

Thanks

Answer : How to create a c++ operator ? (like + - * )

Random Solutions  
 
programming4us programming4us