On 05/24/2017 04:28 PM, Karoly Balogh (Charlie/SGR) wrote:

1., no standard way to determine the length of an array compile time.
sizeof() returns the length in bytes, not the number of elements.
Basically you have to do sizeof(array)/sizeof(elementtype), where the
elementtype has to be the same as when you declare an array.
It's even worse than that - see my other mail. Even the size in bytes is lost, as soon as you try to pass that array as a parameter to function, since it gets implicitly converted to a pointer, and the size is lost, because... who cares about array sizes, this is C! :)

Nikolay
_______________________________________________
fpc-other maillist  -  fpc-other@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other

Reply via email to