0
Need help understanding void functions
I dont understand what a void function in c++ is used for besides that it does not return zero. WHAT DOES THAT EVEN MEAN?
2 Respuestas
+ 1
This may help you!
When used as the return type for a method, void specifies that the method doesn't return a value. void is also used in an unsafe context to declare a pointer to an unknown type. For more information, see Pointer types. void is an alias for the .NET Framework System.Void type.
0
Function can perform some action at it's arguments or it's class without returning a value. For example std::string::clear() makes string empty and don't require to return any value. But in c++ function always should have a return type with only exception for constructors and destructors. So, there is special type void that means nothing.