国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

網(wǎng)站設(shè)置安全哈爾濱seo優(yōu)化

網(wǎng)站設(shè)置安全,哈爾濱seo優(yōu)化,如何制作短視頻教程,網(wǎng)站建設(shè)學(xué)習(xí)學(xué)校文章目錄 C語言開發(fā),指針進(jìn)階。1.字符串與指針的關(guān)系2.指針獲取字符串具體內(nèi)容3.字符串比較,查找,包含,拼接4.字符串大小寫 C語言開發(fā),指針進(jìn)階。 1.字符串與指針的關(guān)系 // // Created by MagicBook on 2023-10-22. …

文章目錄

  • C語言開發(fā),指針進(jìn)階。
    • 1.字符串與指針的關(guān)系
    • 2.指針獲取字符串具體內(nèi)容
    • 3.字符串比較,查找,包含,拼接
    • 4.字符串大小寫

C語言開發(fā),指針進(jìn)階。

1.字符串與指針的關(guān)系

//
// Created by MagicBook on 2023-10-22.
//
#include <stdio.h>int main11() {char str[] = {'d', '1', 's','\0'};//str數(shù)組的字符串是存在全局區(qū),靜態(tài)區(qū)域,修改的時(shí)候拷貝一份到main函數(shù)的棧區(qū),再進(jìn)行修改操作str[1] = 'a';//printf遇到\0結(jié)束printf("%s\n", str);//開辟內(nèi)存地址,指向靜態(tài)區(qū)域里面的aaaa,指針不能修改靜態(tài)全局區(qū)域內(nèi)的字符串內(nèi)容,char *str2 = "aaaa";//崩潰str2[1] = '2';return 0;
}

2.指針獲取字符串具體內(nèi)容

//
// Created by MagicBook on 2023-10-22.
//
#include <stdio.h>int main11() {char str[] = {'d', '1', 's','\0'};//str數(shù)組的字符串是存在全局區(qū),靜態(tài)區(qū)域,修改的時(shí)候拷貝一份到main函數(shù)的棧區(qū),再進(jìn)行修改操作str[1] = 'a';//printf遇到\0結(jié)束printf("%s\n", str);//開辟內(nèi)存地址,指向靜態(tài)區(qū)域里面的aaaa,指針不能修改靜態(tài)全局區(qū)域內(nèi)的字符串內(nèi)容,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',一直循環(huán),while (*string) {string++;cnt++;}return cnt;
}//數(shù)組作為參數(shù)傳遞,會把數(shù)組優(yōu)化成指針
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() {//字符串轉(zhuǎn)換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";//區(qū)分大小寫int ress = strcmp(string1, string2);//不區(qū)分大小寫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,進(jìn)ifif (test) {printf("%s\n", test);} else {}//包含if (test) {} else {}//取位置int index = test - aa;//拼接字符串char test1[22];char *a1 = "11", *a2 = "22", *a3 = "33";//先拷貝到數(shù)組容器中,再拼接字符串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://aloenet.com.cn/news/47444.html

相關(guān)文章:

  • 用ih5做微網(wǎng)站博客可以做seo嗎
  • 提升網(wǎng)站收錄網(wǎng)絡(luò)銷售平臺排名
  • 哈爾濱網(wǎng)站開發(fā)制作岳陽seo快速排名
  • 自己建立公司網(wǎng)站 怎樣做怎么做好營銷推廣
  • 使網(wǎng)站有流量萬能搜索引擎
  • 網(wǎng)站開發(fā)輔助工具地推怎么做最有效
  • 企業(yè)網(wǎng)站建設(shè)框架圖2345網(wǎng)址導(dǎo)航瀏覽器下載
  • 二手車網(wǎng)站模版售價(jià)美國站外推廣網(wǎng)站
  • 做博客的網(wǎng)站有哪些功能seo知識是什么意思
  • aspnet東莞網(wǎng)站建設(shè)多少錢alexa排名查詢統(tǒng)計(jì)
  • 做游戲代練去那個(gè)網(wǎng)站石家莊最新疫情
  • 路橋做網(wǎng)站衡陽seo優(yōu)化首選
  • 婚禮禮網(wǎng)站如何做的aso優(yōu)化服務(wù)站
  • 中山市做網(wǎng)站實(shí)力產(chǎn)品軟文是什么意思
  • 從化網(wǎng)站建設(shè)優(yōu)化今天最新新聞10條
  • wordpress 仿虎嗅主題seo百度推廣
  • 免費(fèi)的ftp網(wǎng)站2021百度熱搜年度榜
  • 免費(fèi)域名的網(wǎng)站百度可以發(fā)布廣告嗎
  • 個(gè)人備案網(wǎng)站做企業(yè)會怎樣湖南靠譜的關(guān)鍵詞優(yōu)化
  • 不用編程做APP和響應(yīng)式網(wǎng)站重慶seo排名方法
  • 靠譜的網(wǎng)站制作專業(yè)公司seo論壇
  • 易企秀網(wǎng)站開發(fā)杭州關(guān)鍵詞推廣優(yōu)化方案
  • wordpress集成微信收款seo服務(wù)銷售招聘
  • 惠州做網(wǎng)站免費(fèi)網(wǎng)站alexa排名查詢
  • 做網(wǎng)站推廣托管費(fèi)用seo網(wǎng)絡(luò)營銷推廣公司深圳
  • 微信網(wǎng)站制作軟件有哪些uc瀏覽網(wǎng)頁版進(jìn)入
  • 簡潔網(wǎng)站欣賞路由優(yōu)化大師
  • 使用php做的網(wǎng)站有哪些西安自助建站
  • 裝飾公司手機(jī)網(wǎng)站湖南網(wǎng)站seo地址
  • 做我韓國連續(xù)劇網(wǎng)站線上營銷技巧和營銷方法