Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) void

 

void is a keyword to specify that a function does not return a value.

 

In the code below, the function 'SayHello' puts the text 'Hello' on the screen, but does not return anything.

 

#include <iostream>

//Function definition
void SayHello()
{
  std::cout << "Hello" << std::endl;
}

int main()
{
  //Function call
  SayHello();
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict