使用strcat返回的时候报错

 

strcat(data, "<?xml version=\"1.0\" encoding=\"GB2312\" standalone=\"yes\" ?>\r\n");

正确的做法是:

memset(buf, 0, 256);
sprintf(buf, "%s", "<?xml version=\"1.0\" encoding=\"GB2312\" standalone=\"yes\" ?>\r\n");
strcat(data, buf);

 
posted @ 2020-06-16 15:13  MoonXu  阅读(233)  评论(0)    收藏  举报