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..
3 Answers
+ 7
the early languages had no functions, therefore no return type. Codes were ugly back then....
+ 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.
0
If there is no return, you have to pass the output to the arguments (pointers or references)