Monday, August 17, 2020

4.1.4 Void

  • The Void type is used in the situation when you do not have any information about value. 
  • It is mostly used with functions. 

  1. If your function does not return a value, then you can define its return type void. For example, you can define the function like this. void myFunction () ;.
  2. If you are not taking any parameters in the function, then you can define void in their place. The Void type shows that no argument is taken in this function. Thus, void can pass as a parameter. int myFunction (void) ;.
  3. If you are unsure that the pointer variable will point to the variable of type, then you can declare its type void. After this you can point to any variable with the void pointer.

No comments:

Post a Comment

Please do not any spam link in Comment Box