[fpc-pascal] H2pas tool vs others, C header translation

Paulo Costa paco.mail.telepac.pt at gmail.com
Mon Aug 28 04:12:28 CEST 2017


On 27-Aug-17 23:47, Dmitry Boyarintsev wrote:
> Is 2 neither true, nor false? 3? 4?
> 
> If false is zero,
> Then true is not false.
> 
> Also C doesn't have a boolean type per se. Iirc it was introduced in 
> some version of c++ standard.
> 
> In C it's very strange to see code like that:
> 
> If (b==1)
> 
> It's always
> If (b)
> Or
> If (!b)

Of course, that is because, in C, any value that is not zero, is true.

So you can not compare with 1 or -1 or any other value to test if it is 
true...

Paulo Costa



More information about the fpc-pascal mailing list