cctype頭文件 cstring頭文件

#include <cctype> 對string對象中單個字符進行處理 git

cctype下標準庫函數: 函數

isalnum(c);isalpha(c);isdigit(c);isxdigit(c);islower(c);isupper(c);isspace(c); spa

isgraph(c);iscntrl(c);ispunct(c);isprint(c);tolower(c);toupper(c) 對象


#include <cstring> 處理c風格字符串(字符串以null結尾) 字符串

cstring下標準庫函數: string

strlen(s) //返回c風格字符串長度,不包括null it

strcmp(s1, s2) //比較大小,返回0(s1==s2),正數(s1>s2),負數(s1<s2) im

strcat(s1, s2) //s2鏈接到s1,返回s1 img

strcpy(s1, s2) //s2複製給s1,返回s1 di

strncat(s1, s2, n) //s2的前n個字符鏈接到s1,返回s1

strncpy(s1, s2, n)//s2的前n個字符複製給s1,返回s1

相關文章
相關標籤/搜索