Hi,
I have some char defined like this:
char _RECUSADA[] = "RECUSADA";
char _TERMINADA[] = "TERMINADA";
And I use them with a function defined like this:
void display_message(char* the_txt1)
{}
The call is like this:
display_message(_RECUSADA);
and it works fine.
But I want also, in some cases, use an index to display a string from an array.
So I have:
char* _PTR_INTER[] = {"INCENDIO","TRANSITO","DIVERSO"};
And I call my function like this:
display_message(_PTR_INTER[1]);
It works, but while compiling I have a warning:
warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
char *_PTR_INTER[] = {"INCENDIO","TRANSITO","DIVERSO"};
Any suggestion to avoid the warning?
Thanks a lot