![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
重载
weixin_42173948
这个作者很懒,什么都没留下…
展开
-
操作符重载的概念
复数相加示例一:#include <stdio.h>class Complex { int a; int b;public: Complex (int a = 0, int b = 0) { this->a = a; this->b = b; } int getA() { return a; } int getB() { return b; } friend Complex Add(const Comple...原创 2020-06-24 19:07:38 · 71 阅读 · 0 评论 -
类函数重载
函数重载必然发生在同一个作用域重载函数本事为不同函数函数名和参数列表决定函数函数必须发生在同一个作用域中#include <stdio.h>class Test{ int i;public:/* 三个构造函数 */ Test() { printf("Test::Test()\n"); this->i = 0; } Test(int i) { ...原创 2020-06-24 09:39:55 · 138 阅读 · 0 评论