为什么我不能检查数组中的位置是否为空?我收到了错误的信息:
对于标记行上的参数类型int,null",运算符==未定义
private static int findNr(int[] trans)
{
int emptyPlace=0;
for (int i=0; i<trans.Length -1;i++)
{
--> if( trans[i] = null) <--
return emptyPlace = trans[i];
}
return emptyPlace;
}
Run Code Online (Sandbox Code Playgroud)