【C语言】自定义连接两个字符串函数
来源:互联网 发布:金融时间序列数据 编辑:程序博客网 时间:2024/05/04 17:37
#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); system("pause"); return EXIT_SUCCESS;}
0 0
- 【C语言】自定义连接两个字符串函数
- c语言连接两个字符串
- 连接两个字符串 C语言
- MDK下连接两个字符串自定义函数
- C语言:自定义字符串函数
- C语言 指针连接两个字符串(一)
- c语言中连接两个字符串
- (c语言)连接两个字符串
- C语言:自定义函数/字符串函数
- 【c语言】将两个字符串连接起来,不要用strcat函数
- C语言 不使用strcat函数实现连接两个字符串功能
- C语言进阶之路------关于字符串函数的小例子(用函数连接两个字符串)
- C语言自定义字符串复制函数
- C语言 - 自定义实现字符串统计函数
- C语言 - 自定义字符串复制函数
- C语言的连接字符串函数
- C语言strcat()函数:连接字符串
- (c语言)字符串连接函数
- sessionStorage 、localStorage 和 cookie 之间的区别(转)
- HDU 1232 通畅工程
- 【51单片机】A/D(1)
- 《互联网+智能家居--传统家居颠覆与重构》(陈根)读书笔记及总结
- AFNetworking 支持cookies的解决方案
- 【C语言】自定义连接两个字符串函数
- getJSON 2 取值
- 类中静态成员与友元
- strrpos.php
- 记录一次使用DDNS通过域名访问服务器的过程
- 移动页面滚动穿透解决方案(荐)
- a标签置灰不可点击
- linux的常用命令
- jquery实现跳转到页面指定位置