基础知识之字符串函数
来源:互联网 发布:税控盘开票软件下载 编辑:程序博客网 时间:2024/05/20 16:36
1.**strcat函数
char *my_strcat(char*sd,const char*si){ assert(sd!=NULL&&si!=NULL); char *str = sd; while(*str++!='\0'); --str; while(*str++=*si++); return sd;} **2.strcpy函数** void my_strcpy(char *str,const char*sd){ /*int num = 0; while(sd[num]!='\0') { str[num]=sd[num]; num++; } str[num]='\0'; //cout<<str<<endl; */ //while(*sd!='\0') //{ *str++ = *sd++; // ++str; // ++sd; //}while(*str++=*sd++ ); //*str='\0';}char* my_strcpy(char*sd,const char*si){ assert(sd!=NULL&&si!=NULL); char *str=sd; while(*str++=*sd++); return sd;}
****3.strcmp**```**int my_strcmp(const char*str,const char*rts){ int k = 0; while((k=*str-*rts)==0&& *str++&& *rts++); return k;}
0 0
- 基础知识之字符串函数
- Java基础知识之字符串
- MySQL基础知识---------字符串比较函数
- Scala基础知识之函数
- Java基础知识之字符串类
- Java基础知识之输入,字符串
- java基础知识之构造函数
- C#基础知识之虚函数
- 基础知识之OB系统函数
- python基础知识之常用函数
- python基础知识之内置函数
- C语言基础知识之函数
- 【ios 基础知识】之 常用字符串的操作
- python3基础知识整理之字符串处理
- C语言基础知识之(六):数组-----数组类型、定义数组、读取数组、排序数组、字符串数组函数
- 数据仓库之字符串函数
- php之字符串函数
- MySQL之字符串函数
- Zookeeper日志文件&事务日志&数据快照
- CentOS7 编译linphone-android v3.9错误汇集
- Xshell配置ssh免密码登录-密钥公钥(Public key)与私钥(Private Key)登录
- 工厂模式例子之计算器的实现
- JavaScript设计模式 Item 6 --单例模式Singleton
- 基础知识之字符串函数
- ubuntu14.04安装360随身wifi 2代
- Cake ZQUOJ 25779
- win7 theano 和 Keras 安装记录
- SQL Server统计数据库中表个数、视图个数、存储过程个数
- Android TextView滚动条设置
- Redis集群方案redis-twemproxy-keepalived
- android 比较靠谱的图片压缩
- 月薪3万的程序员都避开了哪些坑