http://zhidao.baidu.com/question/246385859.html
/*string[] stringArry,将字符串数组转换成大字符串,用逗号分隔比如:string[2] stringArry= {“123”, “abc”},转换成string strs = “123,abc”*/#include<stdio.h>#include<string.h>#define N 4void main(){char *stringArry[N]= {"123","abc","aasdasdsddddd1222bc","asdsadasd"};char str[100]="",*d=str;int i;for(i=0;i<N;i++)sprintf(d+strlen(str),"%s,",stringArry[i]);str[strlen(str)-1]='\0';printf("%s\n",str);}
或:
#define N 256char strs[N];memset(strs, 0x0, N);strcat(strs, stringArray[0]);strcat(strs, ",");strcat(strs, stringArray[1]);