Why do Delphi and Free Pascal usually prefer a signed-integer data type to unsigned one?

后端 未结 4 1616
情话喂你
情话喂你 2020-12-31 03:29

I\'m not a Pascal newbie, but I still don\'t know until now why Delphi and Free Pascal usually declares parameters and returned values as signed integers whereas I see them

4条回答
  •  鱼传尺愫
    2020-12-31 03:45

    • Some string related search functions return -1 when nothing is found.
    • I believe the reasoning behind this is that MaxInt is 2GB which is the maximum size for strings in 32 bit Delphi. This because a single process can have up to 2GB memory

提交回复
热议问题