HITECH C compiler error

Thread Starter

Strathspey

Joined Mar 15, 2011
1
Could somebody please explain the following compiler error:
160. constant operand to || or &&

which points to the following line of code:
LCD_DATA = cmd && 1; /* set RS bit, 1 == data, 0 == command */

Thanks in advance
Pat
 

someonesdad

Joined Jul 7, 2009
1,583
It probably should be a warning, not an error (compiler writer's choice). You need to understand the difference between the && and & binary operators. You probably meant &, not &&.
 
Top