What is the use and importance of the "Return type " function and also return 0 . | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the use and importance of the "Return type " function and also return 0 .

what do they mean?

22nd Jun 2018, 6:48 PM
Kanana Kanana
Kanana Kanana - avatar
1 Answer
0
When writing a function it can either have a return type (specified by you) of no return type at all. For example - in a language like c#, when writing a function can say something like public bool foo(){ return true; } the bool specifies that the function must return a boolean value. If a return type is not needed, you can simply write: public void foo(){} the void specifies that there will be no return type.
22nd Jun 2018, 11:51 PM
Taylor Dean
Taylor Dean - avatar