Return from Void functions in C++

 Void functions means those functions whose return type is void, which sounds like they cannot return anything and but can only print or make some changes to the references provided to them. 

But that's not the case actually there are cases where these functions can return values and even functions(void functions). While my perusal of the C++ documentation of the Geeks for Geeks website I found this another very interesting part of the C++ language or even we can say C language. Previously I had a different type of mindset for void functions, but there are several cases where you can return values from a void function.

Firstly, you can simply return the function without returning any value from the function.

Secondly, you can return a void function from a void function.

Thirdly, you can return a value by typecasting it to void.

There may be more of them but for today this much is fine in my opinion.

 Also, today I got to know many things about the Vectors in C++, included in the vectors header file, their functions, how to pass them to functions, specific cases, problems with some of the functions usage, and lot more. They are excellent for storing values, obviously because of this only they come under Containers

Tomorrow, I will be writing about them, until then... Get Outta here!

Comments

Popular Posts