📜  类实例的参数 c++ 代码示例

📅  最后修改于: 2022-03-11 14:44:53.909000             🧑  作者: Mango

代码示例1
int courseId = 0;
Instructor instructor; // Here we default construct an Instructor
std::string courseName = "Foo";
std::string dept = "Bar";

Course my_course(courseId, instructor, courseName, dept);
//                         ^^^^^^^^^^
//              Here the Instructor is being passed