Mail Archives: djgpp/1997/07/22/14:03:52
Isaac Waldron wrote:
>
> int has_item(int a, int b)
> {
> if (a && b)
should be:
if (a & b)
> int main()
> {
> int a, b, c, d;
> a = a || WEAPON_SWORD_1;
> b = b || WEAPON_SWORD_2;
should be:
a = a | WEAPON_SWORD_1;
b = b | WEAPON_SWORD_2;
In general you have to distinguish the operators
&& and & (the same for || and | and so on). May be
you come from a pascal background where these operators
are the same, but in C there is a differnce between
the comparing oerators (which have the symbol twice) and
the logical bit operators (which have the symbol alone).
Robert
--
*****************************************************************
* Robert Hoehne, Fakultaet fuer Mathematik, TU-Chemnitz-Zwickau *
* Post: Am Berg 3, D-09573 Dittmannsdorf *
* e-Mail: Robert DOT Hoehne AT Mathematik DOT TU-Chemnitz DOT DE *
* WWW: http://www.tu-chemnitz.de/~rho *
*****************************************************************
- Raw text -