📄 string.3
字号:
.TH STRING 3 .SH NAMEstrcat, strncat, strcmp, strncmp, strcpy, strncpy, strlen, index, rindex \- string operations.SH SYNOPSIS.B char *strcat(s1, s2).br.B char *s1, *s2;.PP.B char *strncat(s1, s2, n).br.B char *s1, *s2;.PP.B strcmp(s1, s2).br.B char *s1, *s2;.PP.B strncmp(s1, s2, n).br.B char *s1, *s2;.PP.B char *strcpy(s1, s2).br.B char *s1, *s2;.PP.B char *strncpy(s1, s2, n).br.B char *s1, *s2;.PP.B strlen(s).br.B char *s;.PP.B char *index(s, c).br.B char *s, c;.PP.B char *rindex(s, c).br.B char *s;.SH DESCRIPTIONThese functions operate on null-terminated strings.They do not check for overflow of any receiving string..PP.I Strcatappends a copy of string.I s2to the end of string.IR s1 ..I Strncatcopies at most.I ncharacters.Both return a pointer to the null-terminated result..PP.I Strcmpcompares its arguments and returns an integergreater than, equal to, or less than 0,according as.I s1is lexicographically greater than, equal to, orless than.IR s2 ..I Strncmpmakes the same comparison but looks at at most.I ncharacters..PP.I Strcpycopies string.I s2to.I s1,stopping after the null character has been moved..I Strncpycopies exactly.I ncharacters,truncating or null-padding.I s2;the target may not be null-terminated if the lengthof.I s2is.I nor more.Both return.IR s1 ..PP.I Strlenreturns the number of non-null characters in.IR s ..PP.I Index.RI ( rindex )returns a pointer to the first (last)occurrence of character .I cin string.I s,or zero if.I cdoes not occur in the string..SH BUGS.I Strcmp uses native character comparison, which is signedon PDP11's, unsigned on other machines.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -