Return on C++? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Return on C++?

Can you explain me what is Return in C++.I just cant understand it!!

21st Jul 2017, 10:02 PM
Kevin Paresh
3 Answers
+ 4
return is used in functions, it is used to return something (a processed data) to the function caller, in order for the function caller to be able to use it. return is also a way to directly exits a function, for example you have a function to search for something in a database, when you found it you'll most likely want to quit searching, in such events you use return to exit the function.
21st Jul 2017, 10:24 PM
Ipang
+ 3
It's used to return values processed in a function back to the program for further processing
21st Jul 2017, 10:45 PM
LordGhostX
LordGhostX - avatar
+ 1
ok thank you
21st Jul 2017, 10:27 PM
Kevin Paresh