...
Code Block | ||||
---|---|---|---|---|
| ||||
void my_memset(size_t n, char p[n], char v) { memset( p, v, n); } |
Exceptions
API05-EX0: The extended array syntax is not supported by Microsoft Visual C/C++. Consequently C libraries that must support Windows need not use conformant array parameters.
One option for cross-platform code that must support MSVC would be to use macros:
Code Block | ||||
---|---|---|---|---|
| ||||
#include <stddef.h>
#if defined (_MSC_VER)
#define N(x)
#else
#define N(x) (x)
#endif
int f(size_t n, int a[N(n)]);
|
Bibliography
C11, section 6.7.6.3