Home > Article > Backend Development > What is void in c++
void in C represents empty type data and is used for functions that do not return any value and functions that do not accept any parameters. It can also be used as a pointer type, which can point to any type of data. The void type represents a null value, does not return any value, and is not compatible with other types.
void in C
In C, void is a data type that represents a void type. It is usually used to represent a function that does not return any value.
Uses
void mainly has the following uses:
<code class="cpp">void print_hello();</code>
<code class="cpp">void do_something();</code>
Semantics
Relationships with other types
void has no compatibility or derived relationships with other types. It is a unique type that represents null value.
The above is the detailed content of What is void in c++. For more information, please follow other related articles on the PHP Chinese website!