What role does void play in C++ class methods that print to file or screen?

  • Topic: C/C++ 
  • Thread starter spaghetti3451
  • Start date
  • Tags Tags
    Type
1 reply · 2K views · last reply
spaghetti3451
Messages
1,311
Reaction score
31
Any method (within a C++ class) that prints to a file or to a screen has a return type of void. What role does the keyword void perform?
 
failexam said:
Any method (within a C++ class) that prints to a file or to a screen has a return type of void. What role does the keyword void perform?
It indicates to the compiler that the method does not return a value.