摘要: c#要求所有的运算符重载都声明为public 和static,这表示他们与他们的类或结构相关联,而不与实例相关联。操作符的重载使用operator关键字,C#不允许重载=操作符。下面是一个重载+操作符的列子,代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--staticvoidMain(string[]args){Squarea=newSquare(3,3);Squareb=newSquare(5,5);Squarec=newSquare();c 阅读全文
posted @ 2010-01-17 13:44 Xingsoft 阅读(344) 评论(0) 推荐(0) 编辑