栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

字符串,调用函数与不调用函数

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

字符串,调用函数与不调用函数

#include
#include
int main(void)
{char a[1000]="hello,world!";
 char b[]="miao is beautiful.;
 int i,j=0,n=0,d;
for(i=0;i {
    printf("%c",a[i]);
}
printf("n");
while(a[j]!='')
{
    
    printf("%c",a[j]);
    j++;

}printf("n");

printf("%s",strcat(a,b));//连接两个字符串
while(b[n]!='')
{
a[j+n]=b[n];
n++;
}printf("n");
printf("%s",a);

if(strcmp(a,b)<0)//比较两个字符串大小
printf("yes");

return 0;
}

#include
#include
int main(void)
{int i=0,j=0,d;
 char a[100]="hello,world!";
 char b[]="miao is beautiful.",e='l';
 while(a[i]!=''&&b[j]!='')
{  
    if(a[i]>b[j])
     d=1;
else if(a[i]      d=-1;
else
    d=0;
i++;j++;

}printf("%dn",d);

printf("%d",strchr(a,e)-a);//strrchr为逆序查找,strchr为正序查找
return 0;

    
   

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/513166.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号