C# out parameters vs returns

后端 未结 5 1728
Happy的楠姐
Happy的楠姐 2021-01-11 17:17

So I am new to C# and I am having difficulty understanding out. As opposed to just returning something from a function

using System;
class Retur         


        
5条回答
  •  轮回少年
    2021-01-11 17:50

    Only time I tend to use out is when I need multiple things returned from a single method. Out lets you avoid wrapping multiple objects into a class for return. Check out the example at the Microsoft Out page.

提交回复
热议问题