int search(string [][]mat, int n, string x){
//set indexes for top right element
for(int i = 0; i<n; i++)
{
for(int j = n-1; j>=0; j--)
{
if ( mat[i][j] == x )
{
Debug.Log(x +""+"Found at "+i +" "+j);
// int[] n2 = new int[] {2, 4, 6, 8};
// int [] xyz = new int [] {i, j};
return i;
}
}
}}
如何摆脱此错误:并非所有代码路径都返回值?
错误: * Assets/Scripts/Chess/Bishop.cs(237,22):错误 CS0161:`Bishop.search(string[][], int, string)':并非所有代码路径都返回值*