what if there was no concept of return type? xD | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

what if there was no concept of return type? xD

imagine there wont be concept of return datatype or even return in methods😂😂 so what would have been in place of it..

13th Mar 2017, 8:59 AM
Pankaj Vaghela
Pankaj Vaghela - avatar
3 Answers
+ 7
the early languages had no functions, therefore no return type. Codes were ugly back then....
13th Mar 2017, 10:13 AM
Nikolay Nachev
Nikolay Nachev - avatar
+ 1
What would have been in place of no return types is using a strictly reference based variable system, where you would have to pass in a reference of a variable into every single function. Like this: void multByTwo (int &refVar) { ... } Then the functions have access to those variables by reference and there would be no need to return it.
13th Mar 2017, 8:46 PM
Zeke Williams
Zeke Williams - avatar
0
If there is no return, you have to pass the output to the arguments (pointers or references)
19th Mar 2017, 8:35 AM
hdo
hdo - avatar