Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

zordoloom

  • 3 years ago

Assuming that string1 = "hello" and string2 = "hello world", Which of the following returns 0? A strcmp (string1, string2); b strcmp (string1, string2, 6); c strncmp (string1, string2, 6); d strncmp (string1, string2, 5);

  • This Question is Closed
  1. shahzadjalbani
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    strcmp(string1,string2) is a function which compares two functions if the value of string1 is less than string2 function will return 0 if the value of string1 and string2 are equal function will return 0; if the value of string1 is greater than string2 function will return value greater than 0.

  2. zordoloom
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    So tis A?

  3. shahzadjalbani
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    how it would be A.

  4. shahzadjalbani
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    A will return negative value.

  5. zordoloom
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Oh, ok In this case it has to be d, correct?

  6. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy