![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c语言
个人笔记
r2s
这个作者很懒,什么都没留下…
展开
-
c语言数组指针和指针数组
指针数组 :数组中存放的每个元素都是指针数组指针 :指针指向的是一个数组一维数组 char aa[5] = “1234”;sizeof(aa) / sizeof(aa[0]) : 求数组的个数,包括结束符0 ,’\0’strlen(aa) : 求字符的总个数,不包括结束符 0,’\0’二维数组 char bb[4][5] = { “1234”,“1234” ,“1234” ,“1234” };sizeof(bb) / sizeof(bb[0]) : 求二维数组的行数sizeof(.原创 2022-02-13 23:32:31 · 575 阅读 · 0 评论 -
c语言去除字符串中全部的空字符
//去除字符串中全部的空字符void delAllSpace(char* soucre) { if (soucre == NULL) { printf("delAllSpace: 传参错误"); return; } //strlen() 计算的时数据的真实长度 ,不包含'\0' char* pev = soucre; //字符串前指针 //strlen 计算的总数, str下标从0开始,-1后正好===总数 char* end = soucre + (strlen(soucre)原创 2022-02-13 22:14:48 · 1444 阅读 · 0 评论 -
c语言去除字符串两头的空格
//去除字符串两头的空格void Space(char *soucre) { if (soucre == NULL) { printf("delSpace: 传参错误"); return; } //strlen() 计算的时数据的真实长度 ,不包含'\0' char* pev = soucre; //字符串前指针 //strlen 计算的总数, str下标从0开始,-1后正好===总数 char* end = soucre + (strlen(soucre)-1); //字符串的原创 2022-02-13 20:53:56 · 1341 阅读 · 0 评论