I am trying to check for a NULL character but I get the following error when I try to comiple:
Error C193: '!=': bad operand type
Any suggestion on how to correct the problem? With the information provided, I'd say you should 1) figure out what the bad operand is and 2) fix it. With more information (like the actual line of code that caused the problem and any additional errors that were generated) I could probably come up with a more detailed suggestion. Jon
Like Jon said, just posting the error message without the code to which it relates is pretty pointless! As ever, you need to read the message literally, and think what it's telling you: "'!=': bad operand type" The '!=' (is-not-equal-to) operator should take two operands ("arguments") - it's telling you that one (or both) of them has a "bad type"; ie, is not appropriate to that particular use of the operator. So, you need to look at your code, consider the types of the operands, and ask yourself, "what could be bad?" Obviously, without seeing that code, nobody else can help you there! Remember: if you've had other errors earlier in the compilation, they could well be causing this; eg, if one (or both) of the operands relies on an earlier typedef, and there was an error in the typedef, then the compiler will obviously have problems when it comes to using the typedef! So, the golden rule is: fix the first errors first! "I am trying to check for a NULL character" You mean a NUL character - ASCII code zero?
Remember: you can look-up the error messages by number in the Manual. You can also just click on the message in uVision, then press F1 for a description...
check for a NULL character You have a problem already in your idea of what it is you're trying to do, then. There is no such thing as a "NULL character". NULL is a pointer, not a character. You may be referring to the ASCII character number zero, sometimes referred to as NUL (only one 'L'!), which C programmers express as either an integer literal 0, or the character literal '\0'.
Thanks for all the help. I finnally figured out the problem.