El 08/01/2017 a las 17:31, Bernd Oppolzer escribió:
Please keep in mind that & is a bitwise and in C
whereas && is a logical and;
this makes much difference and has to be implemented or converted
differently
with Pascal, IMO.
the closest equivalence to bitwise and in Pascal are set intersections,
IMO.
If I had to implement that on integers using standard pascal, this would
cause me some headache ...
Both bitwise operations (vars are integers).
C / C++:
a = b & c;
Pascal:
a := b and c;
Both work the same way but pascal does not have the assignment and
testing mess that can be written in C like:
C / C++:
a = b && c;
Pascal:
a := (b<>0) and (c<>0);
--
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal