|
|
1.1 root 1: .TH STRING 3 "19 January 1983"
2: .UC 4
3: .SH NAME
4: strcat, strncat, strcmp, strncmp, strcpy, strncpy, strlen, index, rindex \- string operations
5: .SH SYNOPSIS
6: .nf
7: .B #include <strings.h>
8: .PP
9: .B char *strcat(s1, s2)
10: .B char *s1, *s2;
11: .PP
12: .B char *strncat(s1, s2, n)
13: .B char *s1, *s2;
14: .PP
15: .B strcmp(s1, s2)
16: .B char *s1, *s2;
17: .PP
18: .B strncmp(s1, s2, n)
19: .B char *s1, *s2;
20: .PP
21: .B char *strcpy(s1, s2)
22: .B char *s1, *s2;
23: .PP
24: .B char *strncpy(s1, s2, n)
25: .B char *s1, *s2;
26: .PP
27: .B strlen(s)
28: .B char *s;
29: .PP
30: .B char *index(s, c)
31: .B char *s, c;
32: .PP
33: .B char *rindex(s, c)
34: .B char *s, c;
35: .fi
36: .SH DESCRIPTION
37: These functions operate on null-terminated strings.
38: They do not check for overflow of any receiving string.
39: .PP
40: .I Strcat
41: appends a copy of string
42: .I s2
43: to the end of string
44: .IR s1 .
45: .I Strncat
46: copies at most
47: .I n
48: characters. Both return a pointer to the null-terminated result.
49: .PP
50: .I Strcmp
51: compares its arguments and returns an integer
52: greater than, equal to, or less than 0, according as
53: .I s1
54: is lexicographically greater than, equal to, or less than
55: .IR s2 .
56: .I Strncmp
57: makes the same comparison but looks at at most
58: .I n
59: characters.
60: .PP
61: .I Strcpy
62: copies string
63: .I s2
64: to
65: .I s1,
66: stopping after the null character has been moved.
67: .I Strncpy
68: copies exactly
69: .I n
70: characters, truncating or null-padding
71: .I s2;
72: the target may not be null-terminated if the length of
73: .I s2
74: is
75: .I n
76: or more. Both return
77: .IR s1 .
78: .PP
79: .I Strlen
80: returns the number of non-null characters in
81: .IR s .
82: .PP
83: .I Index
84: .RI ( rindex )
85: returns a pointer to the first (last) occurrence of character
86: .I c
87: in string
88: .I s,
89: or zero if
90: .I c
91: does not occur in the string.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.