strcat(data, "<?xml version="1.0" encoding="GB2312" standalone="yes" ?> ");
正确的做法是:
memset(buf, 0, 256); sprintf(buf, "%s", "<?xml version="1.0" encoding="GB2312" standalone="yes" ?> "); strcat(data, buf);