Json-c库解析包含url的json字符串问题

json-c库会把url中的'/'转译为'/';

可能是json-c规则里面'/'字符另有他用吧;

只能自己编写代码处理一下:

 1 int strdelchr(char *str, char ch)
 2 {
 3     char *p ,*q ;
 4 
 5     for(p=str,q=str; *p!=''; p++)
 6     {
 7         if(*p!=ch)
 8             *q++=*p;
 9     }
10     *q=*p;
11     return 0;
12 }

调用该方法:

1 char download_url[1024] = "http://www.google.com/xxx.xxx/";
2 strdelchr(download_url, '\');
原文地址:https://www.cnblogs.com/slz-coder150315/p/8945641.html