cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
C++ GradeBook string
C++ GradeBook string
Apr 26, 2012 at 3:57am UTC
notetoself5
(1)
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;
}
Apr 26, 2012 at 4:29am UTC
whitenite1
(1785)
@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.