正在加载图片...
●●● ●●●●● 什么是运算符重载 ●●●● ●●● ● int sum.a=3.b=2 sum=atb: (int )=(int)+(int 系统自动 识别数据 float add, x=3.2, y-2.5 类型 add=x+y;(float)(float)+(float) char sti[4],cl[2]="a",c2[2}="b"; str=cl+c2; ( char *(char *) char 编译系统中的运算符“+”本身不能做这种运算,若 使上式可以运算,必须重新定义“+”运算符,这种 重新定义的过程成为运算符的重载。什么是运算符重载 5 int sum,a=3,b=2; sum=a+b; (int)=(int) + (int) float add, x=3.2, y=2.5; add=x+y; (float)=(float) + (float) 系统自动 识别数据 类型 char str[4], c1[2]="a", c2[2]="b"; str=c1+c2; (char *)=(char *) + (char *) 编译系统中的运算符“+”本身不能做这种运算,若 使上式可以运算,必须重新定义“+”运算符,这种 重新定义的过程成为运算符的重载
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有