上一页 1 ··· 265 266 267 268 269 270 271 272 273 ··· 345 下一页
摘要: 在C++中,标准库本身已经对左移运算符>分别进行了重载,使其能够用于不同数据的输入输出,但是输入输出的对象只能是 C++ 内置的数据... 阅读全文
posted @ 2022-08-19 22:47 luoganttcc 阅读(35) 评论(0) 推荐(0)
摘要: 我们以顶层函数的形式进行操作符重载,但是因为无法直接访问 complex 类中的私有成员,故而在类中增添了 getimag()、ge... 阅读全文
posted @ 2022-08-19 22:47 luoganttcc 阅读(13) 评论(0) 推荐(0)
摘要: #include using namespace std;class complex{public: complex(); ... 阅读全文
posted @ 2022-08-19 22:47 luoganttcc 阅读(18) 评论(0) 推荐(0)
摘要: 前面章节中,我们已经学会了将操作符重载函数声明为类的成员函数。除此之外,还可以将操作符重载函数声明为顶层函数。 学习将操作符重载函数... 阅读全文
posted @ 2022-08-19 22:47 luoganttcc 阅读(20) 评论(0) 推荐(0)
摘要: 前面章节中,我们已经学会了将操作符重载函数声明为类的成员函数。除此之外,还可以将操作符重载函数声明为顶层函数。 学习将操作符重载函数... 阅读全文
posted @ 2022-08-19 22:47 luoganttcc 阅读(19) 评论(0) 推荐(0)
摘要: 重载操作符不能改变操作符的优先级和语法特性。例如上一节复数类中的加法操作符重载函数,重载后加法的优先级仍然保持不变,重载后仍然为二元... 阅读全文
posted @ 2022-08-19 22:47 luoganttcc 阅读(15) 评论(0) 推荐(0)
摘要: 重载操作符不能改变操作符的优先级和语法特性。例如上一节复数类中的加法操作符重载函数,重载后加法的优先级仍然保持不变,重载后仍然为二元... 阅读全文
posted @ 2022-08-19 22:47 luoganttcc 阅读(79) 评论(0) 推荐(0)
摘要: #include using namespace std;class complex{public: complex(); ... 阅读全文
posted @ 2022-08-19 22:47 luoganttcc 阅读(29) 评论(0) 推荐(0)
摘要: #include #include using namespace std;class Array{public: Array... 阅读全文
posted @ 2022-08-19 22:47 luoganttcc 阅读(24) 评论(0) 推荐(0)
摘要: #include using namespace std;class Array{public: Array(int leng... 阅读全文
posted @ 2022-08-19 22:47 luoganttcc 阅读(17) 评论(0) 推荐(0)
上一页 1 ··· 265 266 267 268 269 270 271 272 273 ··· 345 下一页