I have read many articles related to ref and out parameters and they helped me to understand the basic concept of these parameters but none of these make me clear about where we have to use ref and where we have to use out.
It would be really appreciated if someone can give me an example that shows a scenario where we can use ref parameter to achieve a functionality that can not be achieved by using out parameter and vice verse.
i know the difference between ref and out parameters.
Ref: I know that we always need to initialize a variable before passed it as ref in a method.
Out: I know that we always need to set value of a variable as out parameter in the calling function before it returns a value.
Is there any example exists in which i can use ref parameter but not out and vice verse ?