char* convert(char b[]) /*倒序*/
{
int n; /*字符串长度*/
int i;
char temp;
n=strlen(b);
for(i=0;i<n/2;i++)
{
temp=b[i]; b[i]=b[n-1-i];b[n-1-i]=temp;
}
return b;
}
void convert_int_to_string(int a,char b[])
{
b[0]=a%10+'0'; /*转换个位*/
if((a/=10)>0) convert_int_to_string(a,&b[1]); /*高位递归解决*/
else b[1]='\0'; /*只有个位*/
}
void contact(char str[],char str1[],char str2[],char str3[])
{
int i,j,k;
for(i=0;str1[i]!='\0';i++)
str[i]=str1[i];
for(j=0;str2[j]!='\0';j++)
str[i+j]=str2[j];
for(k=0;str3[k]!='\0';k++)
str[i+j+k]=str3[k];
}
评论