144k views
0 votes
String member function compare compares two strings (or substrings) and returns 0 if:

A.
The strings are not equal

B.
the strings are equal

C.
if the first string is greater than the second

D.
All of the above.

User Yanique
by
6.0k points

1 Answer

4 votes

Answer:

The correct answer for the given question is option(B). i.e the strings are equal.

Step-by-step explanation:

String are the collection of characters.In the string compare function if both string are equal then it return 0 value otherwise it return non zero value.

if string 1 is greater then the string 2 then it return 1 . in c language

if string 2 is greater then string 1 then it return -1 in c language.

User Shaun Groenewald
by
7.0k points