In: Computer Science
What does the void keyword mean?
In C, if the return type of any function is void then it means it will not return anything to the caller. usually such functions are used to print output or display something.
For example:
void dispaly(int * arr,int n)
{
// iterating throuch the array of elements
for(int i=0;i<n;i++)
cout << arr[i] << " " ;
cout << endl;
}
// Sample output:
// say the length of the array is 4: and the elements : 1,5,6,7. So 1,5,6,7 will be displayed and nothing will be returned to the caller.