付費下載
下載本文檔
版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
字符串處理函數介原型:externintbcmp(constvoid*s1,constvoid*s2,int用法:#includes1s2的前n//#include{char*s2="Goldenglobal printf("s1equaltos2in7bytes");printf("s1notequaltos2in7printf("s1equaltos2in12bytes");printf("s1notequaltos2in12return0;}原型:externvoidbcopy(constvoid*src,void*destint用法:#include//#include{chard[20]; printf("s:printf("d: //bcopyignorenullinstringreturn0;}原型:externvoidbzero(void*s,int用法:#include說明:bzero無返回值。//#include{{inta;floatf;}char //structinitializationtozeroprintf("Initailreturn0;}原型:externvoid y(void*dest,void*src,unsignedcharch,unsignedint用法:#includech則停止NULL。ch被。// #include{chard[20],*p; { printf("Charfound:%s.\n",d);}printf("Charnotreturn0;}原型:externvoid*memchr(void*buf,charch,unsigned用法:#includeNULL//#include{char*p;printf("Notreturn0;} 原型:externintmemcmp(void*buf1,void*buf2,unsignedint用法:#includebuf1和buf2count
當buf1<buf2時,返回值<0當buf1=buf2時,返回值=0當buf1>buf2時,返回值//#include{char*s1="o,Programmers!";char*s2="o,programmers!";intr;printf("s1ands2areidentical");printf("s1lessthans2");printf("s1greaterthanreturn0;}原型:externvoid*memcpy(void*dest,void*src,unsignedint用法:#include功能:由src所指內存區(qū)域count個字節(jié)到dest所指內存區(qū)域。//#include{chard[20];return0;} 原型:externintmemicmp(void*buf1,void*buf2,unsignedint用法:#includebuf1和buf2count個字節(jié)但不區(qū)分字母的大小寫。說明:memicmp同memcmp的唯一區(qū)別是memicmp不區(qū)分大小寫字母。當buf1<buf2時,返回值<0當buf1=buf2時,返回值=0當buf1>buf2時,返回值//#include{char*s1="o,Programmers!";char*s2="o,programmers!";intr;printf("s1ands2areidentical");printf("s1lessthans2");printf("s1greaterthanreturn0;}原型:externvoid*memmove(void*dest,constvoid*src,unsignedint用法:#include//#include{return0;} 原型:externvoid*memset(void*buffer,intc,int用法:#include說明:返回指向buffer的指針。//#include{return0;}原型:extern原型:externvoidmovmem(void*src,void*dest,unsignedint用法:#include//#include{movmem(s,s+7,strlen(s)-s[strlen(s)-return0;}原型:externvoidsetmem(void*buf,unsignedintcount,char用法:#include說明:返回指向buf的指針。//#include{return0;}原型:externchar*stpcpy(char*dest,char用法:#include返回指向dest結尾處字符(NULL)的指針。//#include{chard[20];return0;}原型:externchar*strcat(char*dest,char用法:#include返回指向dest的指針。//#include{char*s="View";return0;}原型:externchar*strchr(char*s,char用法:#include//#include{char*p;printf("Notreturn0;}原型:externintstrcmp(char*s1,char*用法:#include//#include{char*s1="o,Programmers!";char*s2="o,programmers!";intr;printf("s1ands2areidentical");printf("s1lessthans2");printf("s1greaterthanreturn0;}原型:externintstricmp(char*s1,char*用法:#include當s1<s2時,返回值<0//#include{char*s1="o,Programmers!";char*s2="o,programmers!";intr;printf("s1ands2areidentical");printf("s1lessthans2");printf("s1greaterthanreturn0;}原型:externchar*strcpy(char*dest,char用法:#include返回指向dest的指針。//#include{chard[20];return0;} 用法:#include//#include{char*r="new";intn;printf("Thecharbothins1ands2is:return0;}原型:externchar*strdup(char用法:#include//#include{char*d;return0;} 原型:externintstrlen(char用法:#include//#include{printf("%shas%dreturn0;}原型:externchar*strlwr(char用法:#include//#include{return0;}原型:externchar*strncat(char*dest,char*src,int用法:#includesrc所指字符串的前n個字符添加到dest結尾處(覆蓋dest結尾處的'\0')并添加'\0'。//#include{chard[20]="GoldenGlobal";return0;}原型:externintstrcmp(char*s1,char*s2,int用法:#includes1s2的前n個字符。//strncmp.c#include<string.h>{char*s1="o,Programmers!";char*s2="o,programmers!";intr;printf("s1ands2areidentical");printf("s1lessthans2");printf("s1greaterthanprintf("s1ands2areidentical");printf("s1lessthans2");printf("s1greaterthans2");return}原型:externintstrnicmp(char*s1,char*s2,int用法:#includes1s2的前n個字符但不區(qū)分大小寫。說明:strncmpi是到strnicmp的宏定義//#include{char*s1="o,Programmers!";char*s2="o,programmers!";intr;printf("s1ands2areidentical");printf("s1lessthans2");printf("s1greaterthanreturn0;}原型:externchar*strncpy(char*dest,char*src,int用法:#include
srcnNULLNULL字符結束。src和dest所指內存區(qū)域不可以且dest必須有足夠的空間來容納src的字符串。返回指向dest的指針。//#include{char*s="GoldenGlobalchar*d="o,GGVProgrammers";char*p=strdup(s); //enable6linesreturn0;} 原型:externchar*strpbrk(char*s1,char用法:#include//#include{char*s1=" char*s2="BIT";printf("Notprintf("Notreturn0;}原型:externchar*strrev(char用法:#includeNULL//#include{ eTo //6linesperscreenreturn0;}原型:externchar*strset(char*schar用法:#include說明:返回指向s的指針。//#include{return0;}原型:externchar*strstr(char*haystack,char用法:#include說明:返回指向第一次出現needle位置的指針,如果沒找到則返回NULL。//#include{char*l="lob";charprintf("Notreturn0;}
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 鄭州2025年河南新密市招聘教師100人筆試歷年參考題庫附帶答案詳解
- 衡水2025年河北衡水學院選聘工作人員21人筆試歷年參考題庫附帶答案詳解
- 紹興浙江紹興博物館編外人員招聘筆試歷年參考題庫附帶答案詳解
- 湘西2025年湖南湘西州瀘溪縣招聘勞務派遣制教師72人筆試歷年參考題庫附帶答案詳解
- 海南2025年海南瓊臺師范學院附屬桂林洋幼兒園招聘員額制工作人員筆試歷年參考題庫附帶答案詳解
- 河南2025年河南省直第三人民醫(yī)院招聘30人筆試歷年參考題庫附帶答案詳解
- 杭州2025年浙江杭州市西湖區(qū)人民檢察院編外人員招聘筆試歷年參考題庫附帶答案詳解
- 撫州2025年江西撫州市東鄉(xiāng)區(qū)城區(qū)中學臨聘教師招聘100人筆試歷年參考題庫附帶答案詳解
- 廣西2025年廣西職業(yè)技術學院高層次人才招聘21人筆試歷年參考題庫附帶答案詳解
- 山東2025年山東體育學院招聘博士工作人員(第三批)筆試歷年參考題庫附帶答案詳解
- 外科院感課件
- 2025國家核安保技術中心招聘筆試歷年常考點試題專練附帶答案詳解試卷3套
- 12158-2024防止靜電事故要求
- 酒吧內保年終總結
- 兒童講解員禮儀
- 文物建筑勘查設計取費標準(2020年版)
- DB14∕T2248-2020 《煤礦安全風險分級管控和隱患排查治理雙重預防機制實施規(guī)范》
- 千古奇文《初心》原文
- 失禁相關性皮炎與壓力性損傷的區(qū)分鑒別
- 鋁合金門窗設計說明
- 食品行業(yè)倉庫盤點制度及流程
評論
0/150
提交評論