I get this gcc warning with -Wwrite-strings flag. I want to return a string of chars correctly but I also do not want to use malloc. I've read other posts but can somebody explain how to acheive this in layman wording?
a.c:14: warning: passing argument 1 of ‘VAR1’ discards qualifiers from pointer target type
#include <stdio.h>
#include <string.h>
char *VAR1(char *VAR2)
{
static char VAR3[12] = "Hello ";
strcat(VAR3, VAR2);
return VAR3;
}
int main(void)
{
printf("%s", VAR1("World!")); // Hello World!
return 0;
}