strcmp, stricmp, strncmp, strncmpi, strcat, strncat | Beyond C++

by stilling2006 on 2010-06-21 18:24:00

### Translation:

#### strcmp

**Prototype**: `int strcmp(char *s1, char *s2);`

**Function**: Compares the strings `s1` and `s2`.

**Description**:

- Returns a value ` 0` when `s1 > s2`.

**Example**:

```c

char *s1 = "Hello, Programmers!";

char *s2 = "Hello, programmers!";

r = strcmp(s1, s2); // r is less than 0, see ASCII table.

```

---

#### stricmp / strcmpi

**Prototype**: `int stricmp(char *s1, char *s2);`

**Function**: Compares the strings `s1` and `s2` without considering case differences.

**Description**:

- `strcmpi` is a macro definition for `stricmp`, but the actual function `strcmpi` is not provided in some environments.

- Returns a value ` 0` when `s1 > s2`.