b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

c++ strchr函数_strchr函数返回_模拟实现strchr函数(9)

电脑杂谈  发布时间:2017-02-28 08:29:56  来源:网络整理

printf("destinationaftermemcpy:%s\n",dest);

return 0;

}

输出结果:destinationbefore memcpy:abcdefghijlkmnopqrstuvwxyz0123as6

destination after memcpy: ******************************as6

extern void *memchr(const void *buf, intch, size_t count);

从buf所指内存区域的前count个字节查找字符ch。

#include<iostream>

#include<cstring>

using namespace std;

int main()

{

char*s="GoldenGlobalView";

cout<<strlen(s)<<endl;

return 0;

}

输出结果:16

#include<iostream>

#include<cstring>

using namespace std;

int main()

{

char s[]="WelcomeToBeijing";

cout<<strrev(s)<<endl;

return 0;

}

输出结果:nijieBoTemocleW

#include<iostream>

#include<cstring>

using namespace std;

int main()

{

char s1[]="abcdef";

char *s2=strupr(s1);

cout<<s2<<endl;

return 0;

}

输出结果:ABCDEF

#include<iostream>

#include<cstring>

using namespace std;

int main()

{

char s1[]="ABCDEF";

char *s2=strlwr(s1);

cout<<s2<<endl;

return 0;

}

输出结果:abcdef

#include<stdio.h>

#include<string.h>

int main()

{

char*s="GoldenGlobalView";

char*l="lob";

char*p;

p=strstr(s,l);

if(p)

printf("%s",p);

else

printf("NotFound!");

return 0;

}

输出结果:lobalView

extern char *strcat(char *dest,char*src);

把src所指字符串添加到dest结尾处(覆盖dest结尾处的'\0')并添加'\0'。

#include<iostream>

#include<cstring>

using namespace std;

int main()

{

char d[20]="GoldenGlobal";

char s[20]="View";

strcat(d,s);


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-34960-9.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    热点图片
    拼命载入中...