复制构造函数的疑问

最近在B站看C++ 课程,发现复制构造函数调用举例 跟自己的调试不一样。以下是代码。

#include 
using namespace std;
class Point{
    public:
    Point();
    Point(const Point &obj);
    void getPosition();
    private:
    int x,y;
};
Point::Point(){
    cout<<"Calling Constructor "<

下边是打印结果

Calling Constructor
x -400344992 y 32766
Calling Constructor
x 0 y 0
Calling Copying Constructor
x -400344992 y 32766
Calling Copying Constructor
Calling fun1 begin
x -400344992 y 32766
Calling fun1 end
Calling fun2 begin
Calling Constructor
Calling fun2 end
x 0 y 0

B站的视频说在调用fun2()的时候也会发生复制,但是结果里并没有发生。
是我弄错了?

另一个疑问就是:Point aPoint c 初始化顺序不一样,x,y的值也不一样?

你可能感兴趣的:(复制构造函数的疑问)