【面试题】strcmp函数实现
来源:互联网 发布:淘宝女棉拖 编辑:程序博客网 时间:2024/05/02 05:43
#include <iostream>#include <assert.h>using namespace std;int strcmp_mf(const char *src,const char *dst){assert(src != NULL && dst != NULL);while(*src++ == *dst++){if(*src=='\0' && *dst=='\0'){return 1;//比较结果为两个字符串相同}}return 0;//不同}void main(){const char *s1="lmf" ;const char *s2="bxy";if(strcmp_mf(s1,s2)){cout << "They are lovers" <<endl;}else{cout << "They are married" <<endl;}}
- 【面试题】strcmp函数实现
- 程序员面试题精选---strcmp()函数的实现
- 【C语言】【面试题】【笔试题】模拟实现数据库中strcmp函数
- 面试题之strcpy/strlen/strcat/strcmp的实现
- 面试题之strcpy/strlen/strcat/strcmp的实现
- 【面试题】printf函数实现
- 面试题 实现memmove函数
- 【面试题】实现memcpy函数
- strcmp函数实现
- strcmp函数的实现
- 实现strcmp()函数
- strcmp函数的实现
- strcmp函数的实现
- strcmp函数的实现
- 实现strcmp 函数
- C++ - 实现strcmp函数
- 实现strcmp函数
- strcmp函数的实现
- POSIX操作系统的串口编程指南(2) 分类: Linux串口编程
- 不带括号的四则运算步骤
- 《Physically guided liquid surface modeling from videos》TOG2009
- POSIX操作系统的串口编程指南(1)
- printf 计算参数时从右向左压栈
- 【面试题】strcmp函数实现
- 按位异或运算 (正数异或负数)
- 重回VB6.0时代
- 常用数据结构-几种特殊的二叉树
- 最长公共子序列
- Spring 结合 C3P0配置
- s3c2410IIC驱动
- MFC 主对话框弹出非模态对话框后,非模态对话框不能刷新
- shell 编程疑问01