一.赋值运算符 1.赋值类运算符包括两种: (1)基本赋值运算符:= (2)扩展的赋值运算符: += -= *= /= &= 赋值类的运算符优先级:先执行等号右边的表达式,将执行结果赋值给左边的变量 2.例子: public class d17_assigining_operator{ public static void main(String[] args) { int i = 23; i+=5;//这个式子等价于i=i+5; byte a = 5; //a = a
class A { public: A(int arg1, int arg2); ~A(); A &operator = ( A &other); A operator + ( A &other); private: int a, b; }; A::A(int arg1, int arg2) { a = arg1; b = arg2; } A::~A() { } A &A::operator=( A &other) { if (this == &other)