G
G
GmDvlpr2020-04-18 22:38:52
C++ / C#
GmDvlpr, 2020-04-18 22:38:52

Ways to pass parameters to c# methods?

studied the parameters of the methods, now I have a question about passing using ref, out.
As I understand it, ref can take data from a variable, and then transfer the processed data to the same variable, and this variable will change its value to the one that came from ref
But out does not take values ​​from a variable, but must be initialized in its own method, and after processing this value, transfers it to a variable and the variable is assigned the value received from out
I apologize if I did not explain clearly, I think that the picture will be clearer
5e9b5748644d5898847663.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2020-04-18
@GmDvlpr

Tip - open the IDE and give it a try. It will become clearer immediately.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question