0 votes
in C Plus Plus by
What is the concept of a ‘void return type’ in C++?

1 Answer

0 votes
by

In C++, a ‘void return type’ signifies that a function doesn’t return any value. It’s used when the purpose of the function is to perform an action rather than compute and return a result. For instance, a function might modify global variables or write output. However, it won’t provide a value that can be used in further computations or assignments within the calling code. The keyword ‘void’ before the function name in its declaration and definition indicates this. A void function can end either by reaching the end of the function or by executing a return statement with no argument.

...