OOStuBS - Technische Informatik II (TI-II)
2.4
Hauptseite
Zusätzliche Informationen
Klassen
Dateien
Auflistung der Dateien
Datei-Elemente
src
common
string.cc
gehe zur Dokumentation dieser Datei
1
#include <
common/string.h
>
2
3
int
strcmp
(
const
char
* a,
const
char
* b){
4
while
(*a && *b){
5
if
(*a<*b)
6
return
-1;
7
if
(*a>*b)
8
return
1;
9
a++;
10
b++;
11
}
12
return
0;
13
}
14
15
int
strncmp
(
const
char
* a,
const
char
* b,
size_t
n){
16
while
(*a && *b && n--){
17
if
(*a<*b)
18
return
-1;
19
if
(*a>*b)
20
return
1;
21
a++;
22
b++;
23
}
24
return
0;
25
}
Erzeugt am Mon Jun 30 2014 07:13:28 für OOStuBS - Technische Informatik II (TI-II) von
1.8.1.2