이 클래스의 포인터 동적 배열을 가리키는 클래스에 대한 포인터를 만들었습니다. 내가 만든 클래스의 함수 (Student
)를 사용하려고합니다.이중 포인터에서 함수 호출
Student **list;
list[i] = TextToClass(tempCourse);
list[i].SetCourse(x);
list[i].SetGrades(inFile);
할당이 작동합니다. 그러나 이러한 기능을 사용하는 것은 효과가 없습니다. 기능을 사용하려면 어떻게해야합니까?
는list[i]
무엇
student.cpp: In member function ‘void Controller::ReadAndStore()’:
student.cpp:119: error: request for member ‘SetCourse’ in ‘((Controller*)this)->Controller::list[i]’, which is of non-class type ‘Student*’
student.cpp:121: error: request for member ‘SetGrades’ in ‘((Controller*)this)->Controller::list[i]’, which is of non-class type ‘Student*’
[샘플 코드] (http://sscce.org/)는 간결하고 간결해야합니다. – outis
질문을 게시 할 때 항상 "doe1s not work"를 정의하십시오. 컴파일 오류? 런타임 에러? 런타임 오류 : 예상되는 동작입니까? 실제 행동? –