原型:extern void *memset(void *buffer, int c, int count);

用法:#include <string.h>

功能:把buffer所指內存區(qū)域的前count個字節(jié)設置成字符c。

說明:返回指向buffer的指針。


原型:extern int memcmp(void *buf1, void *buf2, unsigned int count);

用法:#include <string.h>

功能:比較內存區(qū)域buf1和buf2的前count個字節(jié)。

說明:
當buf1<buf2時,返回值<0
當buf1=buf2時,返回值=0
當buf1>buf2時,返回值>0

原型:extern void *memmove(void *dest, const void *src, unsigned int count);

用法:#include <string.h>

功能:由src所指內存區(qū)域復制count個字節(jié)到dest所指內存區(qū)域。

說明:src和dest所指內存區(qū)域可以重疊,但復制后src內容會被更改。函數(shù)返回指向dest的指針。

原型:extern void *memcpy(void *dest, void *src, unsigned int count);

用法:#include <string.h>

功能:由src所指內存區(qū)域復制count個字節(jié)到dest所指內存區(qū)域。

說明:src和dest所指內存區(qū)域不能重疊,函數(shù)返回指向dest的指針。

原型:extern void *memchr(void *buf, char ch, unsigned count);

用法:#include <string.h>

功能:從buf所指內存區(qū)域的前count個字節(jié)查找字符ch。

說明:當?shù)谝淮斡龅阶址鹀h時停止查找。如果成功,返回指向字符ch的指針;否則返回NULL。


原型:extern char *stpcpy(char *dest,char *src);

用法:#include <string.h>

功能:把src所指由NULL結束的字符串復制到dest所指的數(shù)組中。

說明:src和dest所指內存區(qū)域不可以重疊且dest必須有足夠的空間來容納src的字符串。
返回指向dest結尾處字符(NULL)的指針。


原型:extern char *strcat(char *dest,char *src);

用法:#include <string.h>

功能:把src所指字符串添加到dest結尾處(覆蓋dest結尾處的'\0')并添加'\0'。

說明:src和dest所指內存區(qū)域不可以重疊且dest必須有足夠的空間來容納src的字符串。
返回指向dest的指針。


原型:extern char *strchr(char *s,char c);

用法:#include <string.h>

功能:查找字符串s中首次出現(xiàn)字符c的位置


原型:extern int strcmp(char *s1,char * s2);

用法:#include <string.h>

功能:比較字符串s1和s2。

說明:
當s1<s2時,返回值<0
當s1=s2時,返回值=0


原型:extern char *strcpy(char *dest,char *src);

用法:#include <string.h>

功能:把src所指由NULL結束的字符串復制到dest所指的數(shù)組中。

說明:src和dest所指內存區(qū)域不可以重疊且dest必須有足夠的空間來容納src的字符串。


原型:extern char *strset(char *s, char c);

用法:#include <string.h>

功能:把字符串s中的所有字符都設置成字符c。


原型:extern char *strcat(char *dest,char *src);

用法:#include <string.h>

功能:把src所指字符串添加到dest結尾處(覆蓋dest結尾處的'\0')并添加'\0'。

說明:src和dest所指內存區(qū)域不可以重疊且dest必須有足夠的空間來容納src的字符串。
返回指向dest的指針。
說明:返回指向s的指針。
返回指向dest的指針。
當s1>s2時,返回值>0
說明:返回首次出現(xiàn)c的位置的指針,如果s中不存在c則返回NULL。


原型:extern int strlen(char *s);

用法:#include <string.h>

功能:計算字符串s的長度

原型:extern char *strlwr(char *s);

用法:#include <string.h>

功能:將字符串s轉換為小寫形式



原型:extern int strnicmp(char *s1,char * s2,int n);

用法:#include <string.h>

功能:比較字符串s1和s2的前n個字符但不區(qū)分大小寫。

說明:strncmpi是到strnicmp的宏定義
當s1<s2時,返回值<0
當s1=s2時,返回值=0
當s1>s2時,返回值>0

說明:只轉換s中出現(xiàn)的大寫字母,不改變其它字符。返回指向s的指針。

說明:返回s的長度,不包括結束符NULL。