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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!