This commit is contained in:
2025-06-23 21:09:25 +09:00
commit 32cd5b9be8
50 changed files with 59220 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
#include <iostream>
class A {
int x;
public:
A(int c) : x(c) {}
A(const A &a) {
x = a.x;
std::cout << "복사 생성" << std::endl;
}
};
class B {
A a;
public:
B(int c) : a(c) {}
B(const B &b) : a(b.a) {}
A get_A() {
A temp(a);
return temp;
}
};
int main() {
B b(10);
std::cout << "---------" << std::endl;
A a1 = b.get_A();
}