Here is an example of when void would be used:
Code:
#include <iostream>
using namespace std;
void example() // example is a function, but I have voided it so it returns nothing to main
int main()
{
example(); // this calls the function example
return 0;
}
void example() // you can now use the function as main has called it
{
code for exapmle would go here{
return; // return nothing to main as example is void
}
this is just one example of it's use in a function, but void has one golden rule:
Never use the command 'void main()' as main must ALWAYS return an integerger or int