Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
c/c++ strncmp シグネチャは次のようになります。
int strncmp ( const char * str1, const char * str2, size_t num );
私の質問は、num が 0 の場合の戻り値は何ですか? 標準はどのように言っていますか?一部のオンライン ドキュメントから回答が得られません。
ありがとう。
では、2 つの文字列からstrncmp多くても文字を比較するため、 を使用すると、何も比較されないため、違いが見つからないため、0 が返されます。numnum == 0
strncmp
num
num == 0