0
What means the "return" anything ?
we use void main() and int main().I. know these are difference. And if we use void(), it won't be return anything and if we use int(), it will be return integer but actually i confused the "return" 's means. can you explain with details?
4 Antworten
+ 1
A return type identifies the type of data the function will deliver to you after ececution
+ 1
Well, in programming there are methods. Methods can return something or not return anything. First ones are called functions, second - procedures. In some languages (not c#) procedures must return integer value.
So, if you want to do something then you write a procedure. If you want to get some value then you write a function.
+ 1
A return statement causes the execution to move from the current subroutine and resume at the point in the code immediately after the subroutine was called.
+ 1
A method with a return type other than void is simply used to return a certain value after that particular method does what its suppose to do. Actually you can even use the "return" keyword with void return type but in this case its not used to return a value but rather exit the method.