C# - Error “not all code paths return a value” with an array as out parameter

后端 未结 6 1316
走了就别回头了
走了就别回头了 2021-01-24 05:49

I currently have the below code:

public int GetSeatInfoString(DisplayOptions choice, out string[] strSeatInfoStrings)

    {
        strSe         


        
6条回答
  •  旧巷少年郎
    2021-01-24 05:54

    You have no final return before the method exits. You are exiting if there are no elements but you need a return at the end. If you are not interested in the value then why not set the return type to void?

提交回复
热议问题