What does ā€œreturnā€ do? Does it repeat a value? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

What does ā€œreturnā€ do? Does it repeat a value?

I replaced 0 with ā€œMain()ā€, and it popped out ā€œHello World!ā€ many times!

25th May 2018, 6:57 AM
Shishir Lohar
Shishir Lohar - avatar
2 Respostas
+ 6
return - returns the value of a function so that you can do something with it, i.e. assign it to a variable
25th May 2018, 7:03 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 1
The phenomenon which occured in your code is called recursion https://www.sololearn.com/learn/CPlusPlus/1641/
25th May 2018, 7:12 AM
į Œį ŒBrains[Abidemi]
į Œį ŒBrains[Abidemi] - avatar