Question: Define a function to compare two C-Strings s1 and s2. This function returns 0 if s1 = s2 and returns an integer equal to the
Define a function to compare two C-Strings s1 and s2. This function returns 0 if s1 = s2 and returns an integer equal to the subtraction of the ASCII codes of the first two different characters if s1 s2. For example, if s1 = ABCD and s2 = ABE, the function returns -2 because: the ASCII code of C minus the ASCII code of E equals -2. As another example, this function returns 65 if s1 = ABA and s2 = AB (the ASCII Code of A the ASCII Code of \0.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
