我刚刚创建了一个带有整数变量和指针变量的类。创建它的对象后,我将它传递给一个函数。即使在返回函数后,程序也不会抛出异常
#include"iostream"
using namespace std;
class A
{
public :
    int i;
    char *c;
    void show();
};
void func(A obj);
int main()
{
    A a;
    a.i = 10;
    a.c = "string";
    cout << " Before Fun " << endl;
    a.show();
    cout << " Going To Call func " << endl;
    func(a);
    cout << " After func " << endl;
    a.show();
    return 0;
}
void A::show()
{
    cout << " The valuses in Object are " << i << '\t' << c  << endl;
}
void func(A aa)
{       
    cout << " The valuses in Object are " << aa.i << '\t' << aa.c  << endl;  
}
在 The Func 中,我正在传递对象 a(来自 main),它将被复制到 aa(func 堆栈)中。所以从func返回后,如果我调用show(指针c将为a的null),它会给我异常但它没有发生。请帮我证明复制构造函数的要求

