Here is my code :
char *name, name_log=\"log-\";
------getting \'name\' from user-----
strcat(name_log, name); char ext[] =
the name_log is pointed at a static place: "log-", which means is could not be modified, while as the first parameter in strcat(), it must be modifiable.
strcat()
try changing name_log's type char* into char[], e.g.
char*
char[]
char[20] name_log = "log-";