안녕하세요? C++ 초보라 고수님들 도움이 필요한 상황이라 질문 드립니다. 아래 TableName 함수에서 int CJobFile ::GetFileNo() 함수를 Call 하고 싶습니다. 호출 부분이 제가 작성한 부분인데, 객체 생성하고 호출하려니 안되네요 ^^; 아래 헤더 파일과 cpp 파일처럼 구현했는데 error: no matching function for call to 라고 계속 뜨네요 ㅜㅜ 고수님들이 고견 부탁드립니다. ------------------ 헤더 파일 -------------------- class CJobFile { public: CJobFile ( Com* com ); virtual ~CJobFile(); int GetFileNo(); }; ------------------- cpp 파일 ------------------------- CJobFile ::CJobFile ( Com* com ) : com_(new CState(com)){ } CJobFile::~CJobFile() { assert(comt_ == nullptr); } std::string TableName() { CJobFile cjf; --> 객체 생성 int flevel = cjf.GetFileNo(); --> 호출 return MakeName(path, number); } int CJobFile ::GetFileNo() { return fileno; }
93
3
0
윈비·2024-10-18
CJobFile의 생성자는 인자를 필요로 하는데 호출 시 인자가 없이 호출해서 발생하는 에러 같습니다. 아래는 수정된 코드이니 참고하시기 바랍니다. // 헤더 파일
class CJobFile {
public:
CJobFile(Com* com); // 생성자가 Com*을 받음
virtual ~CJobFile();
int GetFileN...