Is this the only return value for strcmp() in C?

前端 未结 4 769
小蘑菇
小蘑菇 2021-01-06 17:47

I\'m learning C, and am currently studying String Handling. From where I\'m studying, strcmp() is defined as-

This is a function which c

4条回答
  •  -上瘾入骨i
    2021-01-06 18:17

    0, 1, -1 are like standard values; however you should think about these like: zero, positive, negative.

    In that case, the meanings are:

    • Zero (0) means that strings are equal.
    • Negative (-1 or any other) means that first string is less.
    • Positive (1 or any other) means that first string is more.

提交回复
热议问题