1703| 2
|
[已解决]C++ 复制构造函数 |
10鱼币
最佳答案1.拷贝构造函数的 参数是Point::Point (const Point &p) 类型的
2.你这里相当于有两个构造函数 Point (int xx = 0, int yy = 0) 和 Point (Point &p),根据函数重载规则
Point a (1, 2) 和 Point b (a) 都可以创建一个对象
| ||
小甲鱼最新课程 -> https://ilovefishc.com
|
||
| ||
小甲鱼最新课程 -> https://ilovefishc.com
|
||
| |
小甲鱼最新课程 -> https://ilovefishc.com
|
|
小黑屋|手机版|Archiver|鱼C工作室
( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)
GMT+8, 2025-6-11 15:22
Powered by Discuz! X3.4
© 2001-2023 Discuz! Team.