C++ GradeBook string

I thought void function doesn't return value why is void displayMessage using getCourseName when getCourseName has a return courseName;?


string getCourseName()
{
return courseName;
}

void displayMessage()
{
cout << "Welcome to the grade book for\n" << getCourseName() << "!" << endl;
}

@notetoself5

displayMessage() function is getting a value from getCourseName(), which is not void. displayMessage() though, is not trying to return a value, hence the void designation.
Topic archived. No new replies allowed.