C# testing null error.
when compiling a program with this function:
public static char[] RemoveSN(char[] InChar)
{
char[] OutChar = new char[InChar.Length];
int[] counter = new int[2];
counter[0] = 0;
counter[1] = 0;
while ((counter[0] < InChar.Length) && (counter[1] < OutChar.Length))
{
if (InChar[counter[0]] != null)
{
OutChar[counter[1]] = InChar[counter[0]];
counter[1]++;
}
counter[0]++;
}
return OutChar;
}
I get this error:
exodist@Abydos:~/School/CSharp$ cscc ./StringMath.cs -shared -o StringMath.dll ;cscc ./StringMathTest.cs -lStringMath.dll -o StringMathTest.exe
./StringMath.cs:557: invalid operands to binary `!='
./StringMath.cs:557: no conversion from `int' to `bool'
line 557 is: if (InChar[counter[0]] != null)
|