在C++中运算符是一种特殊的函数名,其地位与函数一样,因此也可以定义成类的友元函数,为了便于对象的使用,利用类成员函数(运算符)的重载和友元的特性,为类的数据重...
代码说明:
在C++中运算符是一种特殊的函数名,其地位与函数一样,因此也可以定义成类的友元函数,为了便于对象的使用,利用类成员函数(运算符)的重载和友元的特性,为类的数据重载定义插入()运算符,以便于该类的对象使用cin和cout进行数据的输入和输出.-in C Operators is a special function name, its status and function, it can also be defined as a category of Friends yuan function, in order to facilitate the use of objects, the use of class member function (Operators) and the Friends of the heavy yuan features, such as heavy-duty data definition insertion (lt; Lt ;) and extraction (gt; gt;) Operators, to the use of such targets and cin court for data input and output.
下载说明:请别用迅雷下载,失败请重下,重下不扣分!