//实例38:字符串函数string.h应用举例
#include<reg51.h> //包含51单片机寄存器定义的头文件
#include<string.h> //包含函数isalpha()声明的头文件
void main(void)
{
unsigned char str1[ ]="Now, The temperature is :";
unsigned char str2[ ]="Now, The temperature is 36 Centgrade:";
unsigned char i;
i=strcmp(str1,str2); //比较两个字符串,并将结果存入i
if(i==0) //str1=str2
P3=0x00;
else
if(i<0) //str1<str2
P3=0xf0;
else //str1>str2
P3=0x0f;
while(1)
; //防止程序“跑飞”
}
![avatar](https://profile-avatar.csdnimg.cn/default.jpg!1)
荣华富贵8
- 粉丝: 225
- 资源: 7653
最新资源
- jdk1.8 Windows版本
- 智能网联实验小车的实验指导文档
- dwg cad 字体 shx 字体
- 智能网联实验小车的实验指导文档
- 智能网联实验小车的实验指导文档
- 智能网联实验小车的实验指导文档
- 智能网联实验小车的实验指导文档
- 快手无人直播变现项目玩法教程,直播间人气轻松破千上热门
- 智能网联实验小车的实验指导文档
- 智能网联实验小车的实验指导文档
- 智能网联实验小车的实验指导文档
- 智能网联实验小车的实验指导文档
- 智能网联实验小车的实验指导文档
- Rust 编程语言的入门教程,适合有一定编程基础的学习者快速上手 教程分为基础语法、核心概念和实用工具三个部分
- 美妆产品进销存管理系统的设计与开发ssm.zip
- 同城绘本馆的设计与开发ssm.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)