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

  • Context: C/C++ 
  • Thread starter Thread starter spaghetti3451
  • Start date Start date
  • Tags Tags
    Type
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
1 reply · 2K views
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?
 
Physics news on Phys.org
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.