#include <stdio.h>
#if 1
//! Set Pin string
const char* const ONCLI_SET_PIN_CMD_STR = "set pin";
#endif
const char* const SINGLE_APP_STRINGS[] =
{
ONCLI_SET_PIN_CMD_STR
};
int main()
{
printf("%s\n", SINGLE_APP_STRINGS[0]);
getchar(); // pause
return 0;
}
Line 12 Error message...
12|error: initializer element is not constant
12|error: (near initialization for 'SINGLE_APP_STRINGS[0]')
=== Build finished: 2 errors, 0 warnings ===
Compiles and runs just fine in C++. Everything's read-only. No changes are needed or desired or attempted on the strings or on the array. What's the problem and how can I fix it?