Hi. Is there any way to get the length of a constant string at compile time, by following ISO C? I have this test code:
It compiles, but I get the following warning:Code:#include <string.h>
int main()
{
const char *text_base = "text base";
char text_full[strlen(text_base) + 10];
return 0;
}
Is there any way fix this so that it follows the C standard?Code:main.c:6: warning: ISO C90 forbids variable length array 'text_full'