国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

連接兩個字符串 C語言

2019-11-11 06:52:07
字體:
來源:轉載
供稿:網友

#include < stdio.h> #include < stdlib.h>

char* strcat_self(char *strFrist,char *strSecond){ int i=0,j=0; static char newstr[20]; char *p; p = newstr; while(*(strFrist+i)!=’/0’){ (p+i) = (strFrist+i); i++; } while(*(strSecond+j)!=’/0’){ (p+i) = (strSecond+j); i++; j++; } return newstr; } int main() { char str1[20],str2[20],*newstr; PRintf(“請輸入第一個字符串:/n”); gets(str1); printf(“請輸入第二個字符串:/n”); gets(str2); newstr = strcat_self(str1,str2); printf(“字符串1:%s 字符串2:%s 連接后:%s/n”,str1,str2,newstr); return 0; }


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 墨竹工卡县| 青龙| 易门县| 乳源| 武乡县| 江安县| 濮阳市| 达州市| 仁寿县| 马边| 竹山县| 汉阴县| 交口县| 武川县| 出国| 原平市| 汝南县| 武功县| 大新县| 宿州市| 墨竹工卡县| 双峰县| 延寿县| 巨鹿县| 墨竹工卡县| 凉山| 平遥县| 临湘市| 贺州市| 绥德县| 开远市| 密云县| 塘沽区| 共和县| 通化市| 北京市| 莱阳市| 岑巩县| 沂源县| 长顺县| 师宗县|