Advertisements
Advertisements
प्रश्न
Write about strcmp() function.
टीपा लिहा
Advertisements
उत्तर
The strcmp() function takes two arguments: string1 and string2. It compares the contents of string1 and string2 lexicographically.
The strcmp() function returns a:
- A positive value if the first differing character in string1 is greater than the corresponding character in string2. (ASCII values are compared)
- Negative value if the first differing character in string1 is less than the corresponding character in string2.
- 0 if string1 and string2 are equal.
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
