What is the difference between ref and out? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

What is the difference between ref and out?

11th Jul 2018, 6:50 PM
Fabian Prymus
Fabian Prymus - avatar
2 Antworten
+ 3
Hello, Fabian Prymus ! "ref" tells the compiler that the object is initialized before entering the function, and "out" tells the compiler that the object will be initialized inside the function. So, while "ref" is two-sided, "out" is not available. https://www.sololearn.com/Course/CSharp/?ref=app
11th Jul 2018, 7:03 PM
Alexander Sokolov
Alexander Sokolov - avatar
0
Thanks!
11th Jul 2018, 7:04 PM
Fabian Prymus
Fabian Prymus - avatar