字符串连接
/* 功能:字符串连接 日期:2013-05-26 */ #include<stdio.h> #include<stdlib.h> #include<math.h> int main(void) { char str1[]=“hello”; char str2[]=" world!“; char str3[20]={0}; int i,tmp,j; for(i=0;i<5;i++) { str3[i]=str1[i]; } tmp=i; for(i=tmp,j=0;j<7;i++,j++) { str3[i]=str2[j]; } printf(“str3=”); for(i=0;i<20;i++) { printf(”%c",str3[i]); } printf(“n”); system(“pause”); return 0; }
Preview
除特别注明外,本站所有文章均为 Windcoder网 原创,转载请注明出处来自: string-concatenation
Loading comments...

Preview
No Data