https://issues.dlang.org/show_bug.cgi?id=23441

Walter Bright <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #5 from Walter Bright <[email protected]> ---
(In reply to kinke from comment #2)
> That NK_LEN macro apparently makes use of a weird special syntax to get the
> length of a C array, see the last 'notes' paragraph in
> https://en.cppreference.com/w/c/language/sizeof.

The cite says:

"Number of elements in any array a including VLA (since C99) may be determined
with the expression sizeof a / sizeof a[0]. Note that if a has pointer type
(such as after array-to-pointer conversion of function parameter type
adjustment), this expression would simply divide the number of bytes in a
pointer type by the number of bytes in the pointed type."

--

Reply via email to