hi, how to overload operators in C++?
所在版块:社会百科 发贴时间:2004-12-28 23:54

用户信息
复制本帖HTML代码
高亮: 今天贴 X 昨天贴 X 前天贴 X 
Normally, following lines are not allowed: double d = 5; d = d^2; //i wanna d to be 25; How do I overload the operator ^ myself, to allow d=d^2? Thanks!
.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!

团结努力,不怕牺牲,排除万难.
我们要发达.
 

 相关帖子 我要回复↙ ↗回到正文
hi, how to overload operators in C++? chancing   (157 bytes , 657reads )
operator's primitive meaning is not allowed to be changed.. hula   (88 bytes , 269reads )
--> icky   (52 bytes , 269reads )
^ is XOR, you can use another operator name for it icky   (0 bytes , 306reads )
depends xscheme   (422 bytes , 624reads )