Answers for "arguments to a class instance c++"

C++
1

arguments to a class instance c++

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
Posted by: Guest on May-14-2021

Browse Popular Code Answers by Language