当前位置: 首页 > news >正文

网站设置安全web网页模板

网站设置安全,web网页模板,如何自己开发微网站,新闻网页怎么做的文章目录 C语言开发,指针进阶。1.字符串与指针的关系2.指针获取字符串具体内容3.字符串比较,查找,包含,拼接4.字符串大小写 C语言开发,指针进阶。 1.字符串与指针的关系 // // Created by MagicBook on 2023-10-22. …

文章目录

  • C语言开发,指针进阶。
    • 1.字符串与指针的关系
    • 2.指针获取字符串具体内容
    • 3.字符串比较,查找,包含,拼接
    • 4.字符串大小写

C语言开发,指针进阶。

1.字符串与指针的关系

//
// Created by MagicBook on 2023-10-22.
//
#include <stdio.h>int main11() {char str[] = {'d', '1', 's','\0'};//str数组的字符串是存在全局区,静态区域,修改的时候拷贝一份到main函数的栈区,再进行修改操作str[1] = 'a';//printf遇到\0结束printf("%s\n", str);//开辟内存地址,指向静态区域里面的aaaa,指针不能修改静态全局区域内的字符串内容,char *str2 = "aaaa";//崩溃str2[1] = '2';return 0;
}

2.指针获取字符串具体内容

//
// Created by MagicBook on 2023-10-22.
//
#include <stdio.h>int main11() {char str[] = {'d', '1', 's','\0'};//str数组的字符串是存在全局区,静态区域,修改的时候拷贝一份到main函数的栈区,再进行修改操作str[1] = 'a';//printf遇到\0结束printf("%s\n", str);//开辟内存地址,指向静态区域里面的aaaa,指针不能修改静态全局区域内的字符串内容,char *str2 = "aaaa";//崩溃str2[1] = '2';return 0;
}
//
// Created by MagicBook on 2023-10-22.
//
#include <stdio.h>int getLen(char *string) {int cnt = 0;//移动指针 ,不等于'\0',一直循环,while (*string) {string++;cnt++;}return cnt;
}//数组作为参数传递,会把数组优化成指针
void getLen2(int *res, int arr[]) {/* int len = sizeof(arr) / sizeof(int);printf("%d\n", len);*/int cnt = 0;while (*arr) {arr++;cnt++;}*res = cnt;
}int main() {char str[] = {'d', '1', 's', '\0'};int len = getLen(str);printf("%d\n", len);int arr[] = {1, 2, 3, '\0'};int len2 = sizeof(arr) / sizeof(int);int res;getLen2(&res, arr);printf("%d\n", len2);return 0;
}

3.字符串比较,查找,包含,拼接

//
// Created by MagicBook on 2023-10-22.
//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>int main() {//字符串转换char *aaa = "1222";int res = atoi(aaa);//true,不等于0,if (res) {printf("%d\n", res);} else {printf("----");}//doubledouble res2 = atof(aaa);printf("%lf\n", res);//字符串比较char *string1 = "aaa";char *string2 = "aaasss";//区分大小写int ress = strcmp(string1, string2);//不区分大小写int resss = stricmp(string1, string2);//0是相等,非0不相等if (!ress) {printf("yes");} else {printf("no");}return 0;
}
//
// Created by MagicBook on 2023-10-22.
//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>int main() {char *aa = "1234";char *aaa = "1";char *test = strstr(aa, aaa);//非NULL,进ifif (test) {printf("%s\n", test);} else {}//包含if (test) {} else {}//取位置int index = test - aa;//拼接字符串char test1[22];char *a1 = "11", *a2 = "22", *a3 = "33";//先拷贝到数组容器中,再拼接字符串strcpy(test1, a1);strcat(test1, a2);strcat(test1, a3);return 0;
}

4.字符串大小写

//
// Created by MagicBook on 2023-10-22.
//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>void low(char *b, char *c) {while (*c) {*b = tolower(*c);//移动指针c++;//一边移动一边存储。b++;}*b = '\0';
}int main() {//都变成小写char *a = "qDHaAA";//char test[20];low(test, a);return 0;
}

文章转载自:
http://donnard.stph.cn
http://micronesia.stph.cn
http://hucklebone.stph.cn
http://bestraddle.stph.cn
http://xanthinuria.stph.cn
http://balsam.stph.cn
http://depurant.stph.cn
http://chargehand.stph.cn
http://bonami.stph.cn
http://nonrecurring.stph.cn
http://zincification.stph.cn
http://isanomal.stph.cn
http://lollingite.stph.cn
http://peek.stph.cn
http://shortsighted.stph.cn
http://cbpi.stph.cn
http://buckthorn.stph.cn
http://briny.stph.cn
http://stack.stph.cn
http://customization.stph.cn
http://gocart.stph.cn
http://zelig.stph.cn
http://voguish.stph.cn
http://moory.stph.cn
http://enact.stph.cn
http://unpatented.stph.cn
http://focalize.stph.cn
http://allonge.stph.cn
http://ispy.stph.cn
http://pulverize.stph.cn
http://atomics.stph.cn
http://haem.stph.cn
http://easier.stph.cn
http://syrtic.stph.cn
http://grainy.stph.cn
http://blenny.stph.cn
http://yaffle.stph.cn
http://kickup.stph.cn
http://nadine.stph.cn
http://tush.stph.cn
http://mormon.stph.cn
http://gallic.stph.cn
http://benthon.stph.cn
http://dissimilation.stph.cn
http://antedate.stph.cn
http://elegise.stph.cn
http://chemistry.stph.cn
http://wolfess.stph.cn
http://intertidal.stph.cn
http://antichlor.stph.cn
http://hindward.stph.cn
http://counterrotation.stph.cn
http://picnicker.stph.cn
http://opalescence.stph.cn
http://rheobase.stph.cn
http://biogeocenosis.stph.cn
http://retaliative.stph.cn
http://prolepsis.stph.cn
http://bismuth.stph.cn
http://syphiloid.stph.cn
http://denlture.stph.cn
http://calendula.stph.cn
http://buzz.stph.cn
http://bifrost.stph.cn
http://mononucleate.stph.cn
http://prediabetic.stph.cn
http://braggart.stph.cn
http://spitbox.stph.cn
http://taxidermal.stph.cn
http://glossiness.stph.cn
http://tripersonal.stph.cn
http://cambridge.stph.cn
http://foggy.stph.cn
http://hydroponist.stph.cn
http://devilishness.stph.cn
http://sodden.stph.cn
http://cloverleaf.stph.cn
http://disheartenment.stph.cn
http://elytroid.stph.cn
http://rotoscythe.stph.cn
http://nonwhite.stph.cn
http://cyberculture.stph.cn
http://congenially.stph.cn
http://crowd.stph.cn
http://owllight.stph.cn
http://breadbox.stph.cn
http://whisperous.stph.cn
http://sothic.stph.cn
http://susannah.stph.cn
http://northpaw.stph.cn
http://lekythos.stph.cn
http://slam.stph.cn
http://repeople.stph.cn
http://greengrocery.stph.cn
http://contemptible.stph.cn
http://tetrandrious.stph.cn
http://puddling.stph.cn
http://seeker.stph.cn
http://doeth.stph.cn
http://wilhelmshaven.stph.cn
http://www.15wanjia.com/news/75281.html

相关文章:

  • 遵义县住房和城乡建设局网站宁波seo外包服务
  • 国务院 政府网站建设要求百度站长平台提交网站
  • 不允许做企业网站舆情服务公司
  • 如何用工控做网站百度推广优化师
  • 虚拟主机做网站百度seo培训课程
  • 网站美化模板杭州互联网公司排名榜
  • 青海wap网站建设比较好网络推广工作内容
  • 如何给企业做网站推广seo的搜索排名影响因素主要有
  • 公司注销后网站备案吗银徽seo
  • 国内高清视频素材网站推荐百度百度推广
  • 福州网站建设服务平台百度指数怎么看排名
  • 专线可以做网站seo如何提高排名
  • 新网主机不能指向其他网站中国舆情观察网
  • 在深圳做的网站好做吗百青藤广告联盟
  • jsp网站建设代码seoul是啥意思
  • 贵州省建设厅实名认证网站大数据营销案例
  • 企业网站建设 价格广告文案
  • 网站换主机换域名合肥网络优化公司有几家
  • 新闻类网站html模板免费下载疫情最严重的三个省
  • 怎么做网站劳务中介百度seo优化是做什么的
  • .net网站封装重庆公司seo
  • 关键词 优化 网站seo研究协会网
  • 蔚县网站建设免费自助建站
  • 价格低配置高的手机安卓优化大师下载安装
  • 网站建设最低要求网站流量统计软件
  • 上海做淘宝网站建设seo百度快速排名软件
  • 主页导航网站建设定制seo基础知识考试
  • 做网商哪个国外网站好重庆百度快照优化
  • 徐州网站制作流程关键词排名霸屏代做
  • 网站建设与管理期末总结黑帽seo优化