Ref keyword is used to send the particular parameter as a reference to the function or subroutine.
In some cases we may want to return value from the function but we don't want to use that variable within the function. We just get back some value, that's all. In these kind of scenarios we may go with 'out' parameter.
The main difference between the two is, before passing ref parameter we must initialize the particular variable. But this kind of initialization is not necessary with 'out' parameter.
No comments:
Post a Comment
Please give your valuable comments to improve the contents