나는 기본적인 라이브러리 목록 시스템을 모방 한 일련의 코드를 가지고있다. items라는 이름의 기본 클래스가 있는데 여기에는 일반 ID, 제목 및 연도 변수가 정의되고 기타 3 개의 파생 클래스 (DVD, Book 및 CD)가 있습니다.이러한 경고에 대한 도움말. [상속]
베이스 [항목]
파생 된 [DVD, 책, CD].
프로그램이 실행되지만 다음 경고가 표시됩니다.이를 해결하는 방법을 모르겠습니다.
>"C:\Program Files\gcc\bin/g++" -Os -mconsole -g -Wall -Wshadow -fno-common mainA4.cpp -o mainA4.exe In file included from mainA4.cpp:5: a4.h: In constructor `DVD::DVD(int, std::string, int, std::string)': a4.h:28: warning: `DVD::director' will be initialized after a4.h:32: warning: base `Items' a4.h:32: warning: when initialized here a4.h: In constructor `Book::Book(int, std::string, int, std::string, int)': a4.h:48: warning: `Book::numPages' will be initialized after a4.h:52: warning: base `Items' a4.h:52: warning: when initialized here a4.h: In constructor `CD::CD(int, std::string, int, std::string, int)': a4.h:66: warning: `CD::numSongs' will be initialized after a4.h:70: warning: base `Items' a4.h:70: warning: when initialized here >Exit code: 0
고맙습니다. – silent
감사합니다. –