cplusplus
.com
教程
參考
文章
論壇
C++
教程
參考
文章
論壇
參考
C 庫
<cassert> (assert.h)
<cctype> (ctype.h)
<cerrno> (errno.h)
C++11
<cfenv> (fenv.h)
<cfloat> (float.h)
C++11
<cinttypes> (inttypes.h)
<ciso646> (iso646.h)
<climits> (limits.h)
<clocale> (locale.h)
<cmath> (math.h)
<csetjmp> (setjmp.h)
<csignal> (signal.h)
<cstdarg> (stdarg.h)
C++11
<cstdbool> (stdbool.h)
<cstddef> (stddef.h)
C++11
<cstdint> (stdint.h)
<cstdio> (stdio.h)
<cstdlib> (stdlib.h)
<cstring> (string.h)
C++11
<ctgmath> (tgmath.h)
<ctime> (time.h)
C++11
<cuchar> (uchar.h)
<cwchar> (wchar.h)
<cwctype> (wctype.h)
容器
C++11
<array>
<deque>
C++11
<forward_list>
<list>
<map>
<queue>
<set>
<stack>
C++11
<unordered_map>
C++11
<unordered_set>
<vector>
輸入/輸出
<fstream>
<iomanip>
<ios>
<iosfwd>
<iostream>
<istream>
<ostream>
<sstream>
<streambuf>
多執行緒
C++11
<atomic>
C++11
<condition_variable>
C++11
<future>
C++11
<mutex>
C++11
<thread>
其他
<algorithm>
<bitset>
C++11
<chrono>
C++11
<codecvt>
<complex>
<exception>
<functional>
C++11
<initializer_list>
<iterator>
<limits>
<locale>
<memory>
<new>
<numeric>
C++11
<random>
C++11
<ratio>
C++11
<regex>
<stdexcept>
<string>
C++11
<system_error>
C++11
<tuple>
C++11
<type_traits>
C++11
<typeindex>
<typeinfo>
<utility>
<valarray>
<cstring> (string.h)
函式
memchr
memcmp
memcpy
memmove
memset
strcat
strchr
strcmp
strcoll
strcpy
strcspn
strerror
strlen
strncat
strncmp
strncpy
strpbrk
strrchr
strspn
strstr
strtok
strxfrm
型別
size_t
宏常量
NULL
參考
<cstring>
strcoll
函式
<cstring>
strcoll
int strcoll ( const char * str1, const char * str2 );
使用 locale 比較兩個字串
根據當前選擇的
LC_COLLATE
類別
C locale
,對 C 字串
str1
和
str2
進行適當解釋並比較。
該函式從每個字串的第一個字元開始比較。如果它們彼此相等,則繼續比較下一對字元,直到字元不同或遇到表示字串結束的空字元為止。
此函式的行為取決於所選
LC_COLLATE
C locale
的類別。
引數
str1
要比較的 C 字串。
str2
要比較的 C 字串。
返回值
返回一個整數值,指示兩個字串之間的關係
返回值為零表示兩個字串相等。
大於零的值表示第一個不匹配的字元在
str1
中的值大於在
str2
中的值;小於零的值表示相反的情況。
另見
strcmp
比較兩個字串
(函式)
strncmp
比較兩個字串的字元
(函式)
memcmp
比較兩個記憶體塊
(函式)