4 ms·
As this is valid, but only useful as documentation: void foo(const int n, const char data[n]) Is this also valid? void foo(const int n, const char da
by hoppelhase 8y ago
As this is valid, but only useful as documentation:
void foo(const int n, const char data[n])
Is this also valid?
void foo(const int n, const char data[static n])
- codys 8y agoThe `n` may be any assignment-expression, and as a result values like `n` are appear to be allowed by the standard. I've used this in code compiled with gcc and clang. Both accept this construct, but I'm not sure how effectively any compiler is able to use this information to emit warnings/errors.