[fpc-pascal] C# translatation

José Mejuto joshyfun at gmail.com
Sun Jan 8 17:46:03 CET 2017


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);

-- 




More information about the fpc-pascal mailing list