有这么一段C++代码:
#include <cstdio>
class CExample {
int x, y;
public:
CExample(int va, int vb) {
x = va;
y = vb;
}
CExample(const CExample& C) {
x = C.x;
y = C.y;
}
~CExample() {
printf("~CExample()\n");
}
void Show () {
printf("%d, %d\n", x, y);
return ;
}
};
void fun(CExample E) {
printf("In F(CExample)\n");
return ;
}
int main() {
CExample A(100, 200);
CExample B = A;
B.Show();
fun(A);
return 0;
}
编译调试的环境是 VC 6.0,注释如下:
main 函数:
30: int main() {
00401130 push ebp
00401131 mov ebp,esp
00401133 push 0FFh
00401135 push offset __ehhandler$_main (00413422)
0040113A mov eax,fs:[00000000]
00401140 push eax
00401141 mov dword ptr fs:[0],esp
00401148 sub esp,5Ch
0040114B push ebx
0040114C push esi
0040114D push edi
0040114E lea edi,[ebp-68h]
00401151 mov ecx,17h
00401156 mo