```1`STRING(3)                  Library Functions Manual                  STRING(3)`
2
3
4
```

## NAME

```6`       strcat,  strncat,  strcmp,  strncmp,  strcpy,  strncpy,  strlen, index,`
7`       rindex - string operations`
8
```

## SYNOPSIS

```10`       char *strcat(s1, s2)`
11`       char *s1, *s2;`
12
13`       char *strncat(s1, s2, n)`
14`       char *s1, *s2;`
15
16`       strcmp(s1, s2)`
17`       char *s1, *s2;`
18
19`       strncmp(s1, s2, n)`
20`       char *s1, *s2;`
21
22`       char *strcpy(s1, s2)`
23`       char *s1, *s2;`
24
25`       char *strncpy(s1, s2, n)`
26`       char *s1, *s2;`
27
28`       strlen(s)`
29`       char *s;`
30
31`       char *index(s, c)`
32`       char *s, c;`
33
34`       char *rindex(s, c)`
35`       char *s;`
36
```

## DESCRIPTION

```38`       These functions operate on null-terminated strings.  They do not  check`
39`       for overflow of any receiving string.`
40
41`       Strcat  appends  a  copy of string s2 to the end of string s1.  Strncat`
42`       copies at most n characters.  Both return a pointer to the  null-termiā`
43`       nated result.`
44
45`       Strcmp  compares  its  arguments  and  returns an integer greater than,`
46`       equal to, or less than 0, according as s1 is lexicographically  greater`
47`       than, equal to, or less than s2.  Strncmp makes the same comparison but`
48`       looks at at most n characters.`
49
50`       Strcpy copies string s2 to s1, stopping after the  null  character  has`
51`       been  moved.   Strncpy copies exactly n characters, truncating or null-`
52`       padding s2; the target may not be null-terminated if the length  of  s2`
53`       is n or more.  Both return s1.`
54
55`       Strlen returns the number of non-null characters in s.`
56
57`       Index  (rindex)  returns  a  pointer  to the first (last) occurrence of`
58`       character c in string s, or zero if c does not occur in  the string.`
59
```

## BUGS

```61`       Strcmp uses native character comparison, which is  signed  on  PDP11's,`
62`       unsigned on other machines.`
63
64
65
66`                                                                     STRING(3)`
```