asked 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.

asked
User Yanique
by
7.3k 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.

answered
User Shaun Groenewald
by
8.3k points