LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-25-2004, 03:45 PM   #1
exodist
Senior Member
 
Registered: Aug 2003
Location: Portland, Oregon
Distribution: Arch
Posts: 1,374

Rep: Reputation: 47
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)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Testing port 6881....NAT Error - error in Azureus dr_zayus69 Linux - Security 20 05-26-2006 01:52 PM
fstab-sync: error: libhal_ctx_init_direct: (null): (null) rpz Linux - Hardware 1 11-01-2005 05:42 AM
Kernel Null Pointer Dereference Error Smillie Slackware 3 04-27-2005 05:21 PM
NULL pointer dereference error Mercman2000 Linux - General 1 03-21-2005 09:36 PM
reoccuring /dev/null error on bootup mehesque Linux - Newbie 3 01-13-2004 04:48 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration