나는 fallowing 헤더 파일을 가지고 있습니다. 이 오류가 발생합니다 : expected ')' before 'A'
왜 이까요? 나는 아이디어에서 ... 난`을 재 작성하고 교체 시도하고 난 종속성 헤더의 내용, ... 문제의 원인이 될 수 있습니다 알고헤더 파일 ~ synatx 오류 (괄호를달라고하는 것)
#ifndef UICONSOLE_H_
#define UICONSOLE_H_
#include "Catalog.h"
#include <string>
using namespace std;
class UIconsole{
public:
UIconsole(Catalog A); // error here.
void runUI();
private:
void showMenu();
string getString();
int getOption();
void addStudent();
void removeStudent();
void editStudent();
void printStudent();
void printAllStudents();
void addAssignment();
void removeAssignment();
void editAssignment();
void printAssignment();
void printAllAssignment();
void printAllUnder5();
void sortAlphabetically();
void searchById();
};
#endif /* UICONSOLE_H_ */
편집을 해달라고 :
#ifndef CATALOG_H_
#define CATALOG_H_
#include <string>
#include "UIconsole.h"
#include "Catalog.h"
#include "StudentRepository.h"
#include "StudentValidator.h"
using namespace std;
class Catalog{
private:
StudentRepository studRepo;
StudentValidator studValid;
public:
Catalog(StudentRepository stre, StudentValidator stva):studRepo(stre),studValid(stva){};
void addNewStudent(string name, int id, int group);
void removeStudent(string name);
void editStudent(int name, int id, int group);
Student seachStudent(string name);
};
#endif /* CATALOG_H_ */
Catalog.h –
의 내용도 표시 할 수 있습니까?'Catalog.h'는 예상 한대로 수행되지 않습니다. 컴파일러가'Catalog'에 대한 선언을 아직 보지 못했기 때문에 오류가 발생합니다. . –
@MichaelBurr 답변으로 게시해야한다고 생각합니다. –