0
나는 학생 개체 배열이 코스 안에 있습니다. 학생 이름 []에 할당 할 배열 크기를 어떻게 초기화합니까? 내가 포인터 또는 배열을 사용해야합니까?클래스 개체 내부에 배열을 할당하는 방법
#include <iostream>
#include "student.h"
#include "course.h"
int main(int argc, char** argv) {
Student student[4];
Course computerClass(student);
return 0;
}
#ifndef COURSE_H
#define COURSE_H
#include "student.h"
class Course
{
private:
Student name[];
public:
Course();
Course(Student []);
};
#endif
#include "course.h"
#include <iostream>
using namespace std;
Course::Course()
{
}
Course::Course(Student []){
}
감사합니다,하지만 당신은 생성자의 매개 변수에 const를 사용합니까 왜 그냥 궁금? – Vanishadow