int A(const char* name){
name = "Here you GO!";
char* new_name;
//strcpy(new_name,name);
new_name = const_cast<char *>(name);
printf("%s\n", new_name);
return 0;
}
This is the source code which I am testing.
one problem is when I use const_cast<char *>
, it says it is undeclared. (I know it can work under 'g++' compiling)
Anther problem is when I try to use strcpy
to combine them together, it pops up segmentation fault.
the premise is I have to use gcc whatevername.c -std=c99
to compile.
Is anyone offer some suggestion how to solve that. Much appreciate..