Ask Your Question
4

Is it possible for strcmp to return a value of 1 even when the inputs are identical?

asked 2023-03-27 11:00:00 +0000

plato gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-08-21 06:00:00 +0000

bukephalos gravatar image

No, it is not possible for strcmp to return a value of 1 when the inputs are identical. The strcmp function returns 0 if the two strings are identical, and returns a negative value if the first string is less than the second string alphabetically, or a positive value if the first string is greater than the second string alphabetically.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-03-27 11:00:00 +0000

Seen: 8 times

Last updated: Aug 21 '21