Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

zordoloom

  • 2 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
    • 2 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
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    So tis A?

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

    how it would be A.

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

    A will return negative value.

  5. zordoloom
    • 2 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

Ask a Question
Find more explanations on OpenStudy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.