[fpc-pascal] RE: Problem translating c code to pascal

Marc Santhoff M.Santhoff at t-online.de
Sun Oct 1 01:57:37 CEST 2006


Am Samstag, den 30.09.2006, 11:48 -0300 schrieb Felipe Monteiro de
Carvalho:
> Ok, after a lot of headaches and making questions on ##c freenode
> channel I found out what that is.
> 
> The structure is a NULL-terminated array / table. It was declared like this:
> 
> static const handler_rec hw_handlers[] = {
>     { "hw-app", hw_handle_req },
>     { NULL }
> };
> 
> But that is just the short declaration for something like this:
> 
> static const handler_rec hw_handlers[] = {
>     { "hw-app", hw_handle_req },
>     { NULL, NULL }
> };
> 
> 
> So it´s an array of size 2, where the second element is filled with
> NULLs, but it will be interpreted as an array of size 1, because the
> last element marks the end of the array.

Thanks for making the explanation public,
Marc





More information about the fpc-pascal mailing list