2 ms·
Well, you can declare your variable as const char s[] = "...". And if strncmp were to be defined today, it really should have a prototype of int strncmp(size_t
by Ded7xSEoPKYNsDd 12y ago
Well, you can declare your variable as const char s[] = "...". And if strncmp were to be defined today, it really should have a prototype of int strncmp(size_t n, const char s1[static n], const char s2[static n]). This is valid C99, although it seems nobody writes code like this and prefers to degrade their arrays to pointers. (Today's C also has pointers to arrays, so the need for dynamic allocation is no valid excuse either.)