The void keyword allows us to create functions that either do not require any parameters or do not return a value.
The following example shows a function that does not return a value.
void Print_Square(int Number);
main()
{
Print_Square(10);
exit(0);
}
void Print_Square(int Number)
{
printf("%d squared is %d\n",Number, Number*Number);
}
|
The next example shows a function that does not require any parameters:
#include |
void example
Functions
Void pointers
| Top | Master Index | Keywords | Functions |