Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336
If the two strings are found to be unequal then strcmp returns difference between the first non-matching pair of characters. ?->(Show Answer!)
Question Set

1. If the two strings are found to be unequal then strcmp returns difference between the first non-matching pair of characters.



Ask Your Doubts Here

Type in
(Press Ctrl+g to toggle between English and the chosen language)

Comments

  • By: guest on 01 Jun 2017 06.02 pm
    g = strcmp(s1, s2); returns 0 when the strings are equal, a negative integer when s1 is less than s2, or a positive integer if s1 is greater than s2, that strcmp() not only returns -1, 0 and +1, but also other negative or positive values(returns difference between the first non-matching pair of characters between s1 and s2). A possible implementation for strcmp() in "The Standard C Library". int strcmp (const char * s1, const char * s2) { for(; *s1 == *s2; ++s1, ++s2) { if(*s1 == 0) return 0; } return *(unsigned char *)s1 < *(unsigned char *)s2 ? -1 : 1; }
Show Similar Question And Answers
QA->The sum of squares of two numbers is 80 and the square of difference between the two numbers is Find the product of two numbers.....
QA->Distance between two stations A and B is 778 km. A train covers the journey from A to B at 84 km per hour and returns back to A with a uniform speed of 56km per hour. Find the average speed of the train during the whole journey?....
QA->The sum of two numbers is 25 and their difference is Then their product is....
QA->The sum of two numbers is 14 and their difference is Find the product of the two numbers.....
QA->A man who can swim 48 m/minute in still water. He swims 200 m against the current and 200 m with the current. If the difference between those two times is 10 minutes, what is the speed of the current?....
MCQ->If the two strings are found to be unequal then strcmp returns difference between the first non-matching pair of characters.....
MCQ->If s1 and s2 are references to two strings then which of the following are the correct ways to find whether the contents of the two strings are equal? if(s1 = s2) if(s1 == s2) int c; c = s1.CompareTo(s2); if( strcmp(s1, s2) ) if (s1 is s2)....
MCQ->Which two statements are true about comparing two instances of the same class, given that the equals() and hashCode() methods have been properly overridden? If the equals() method returns true, the hashCode() comparison == must return true. If the equals() method returns false, the hashCode() comparison != must return true. If the hashCode() comparison == returns true, the equals() method must return true. If the hashCode() comparison == returns true, the equals() method might return true.....
MCQ->If the two strings are identical, then strcmp() function returns....
MCQ->Which of the following statements are correct about the String Class in C#.NET? Two strings can be concatenated by using an expression of the form s3 = s1 + s2; String is a primitive in C#.NET. A string built using StringBuilder Class is Mutable. A string built using String Class is Immutable. Two strings can be concatenated by using an expression of the form s3 = s1&s2;....
Terms And Service:We do not guarantee the accuracy of available data ..We Provide Information On Public Data.. Please consult an expert before using this data for commercial or personal use | Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions
Question ANSWER With Solution