[C++] 상호참조를 할만한 두 구조체를 만들고 선언부와 구현부를 분리해보자
#include #include using namespace std; // 구조체 선언부 struct Teacher; struct Student; // 구조체 정의부 struct Teacher { string name; int id; string subject; // Teacher 함수 선언부 Teacher(); Teacher(string _name, int _id, string _subject); void Teach(); void ShowInfo(); }; struct Student { string name; int id; int achievement; // Student 함수 선언부 Student(); Student(string _name, int _id, int _achievement); void ..
2022.06.16