1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
amm1812
3 years ago
7

Explain what the problems with the implementation of the function are, and show a way to fix them.// return true if two C string

s are equalbool match(const char str1[], const char str2[]){bool result = true;while (str1 != 0 && str2 != 0) // zero bytes at ends{if (str1 != str2) // compare corresponding characters{result = false;break;}str1++; // advance to the next characterstr2++;}if (result) {result = (str1 == str2); // both ended at same time?}return( result );}int main(){char a[10] = "pointy";char b[10] = "pointless";if (match(a,b)){cout << "They're the same!" << endl;}}
Computers and Technology
1 answer:
Nataly [62]3 years ago
7 0

Answer:

The code is not dereferencing the pointers. You have to place an asterisk in front of the pointer to read the value the pointer points to.

Explanation:

So "if (str1 != str2)" must be "if (*str1 != *str2)".

likewise:

   while (*str1 != 0 && *str2 != 0)

and

     result = (*str1 == *str2);

You might be interested in
What version of ubuntu is linux mint 17.3 based on?
aliina [53]
It would be version 14.04! I run Ubuntu Linux on my pc with dual boot with Kali Linux! I hope this helped!

3 0
3 years ago
Write a paragraph expressing how you'd use the computer to enhance your place of work.​
Charra [1.4K]

Answer:

Have water by, have it organized, and have notes by you welcome.

Explanation:

4 0
3 years ago
All of the following are simple steps for optimizing web page content except:
dangina [55]

Answer:

The correct answer is letter "B": segmenting computer servers to perform dedicated functions.

Explanation:

Computer segmentation refers to separating a server from the rest of the computers within the same network. The segmentation can separate one computer from others or groups of servers from one another. Thew type of segmentation will always depend on the device used to do the separation of the servers.

3 0
3 years ago
3423509 join the kahoot its for fun its about the holidayss:)
zheka24 [161]

Answer:

:)

Explanation:

7 0
2 years ago
Conflict on cross-cultural teams
mars1129 [50]

Answer:

A : is inevitable and should just be ignored until it blows over

Explanation:

Hopefully this helps!

3 0
2 years ago
Read 2 more answers
Other questions:
  • The main differences between laptops and desktop computers other than size and portability.
    14·1 answer
  • Define lan wan &amp; man
    14·1 answer
  • This toolbar has icons representing the application's basic operations such as Save and Copy. Drawing Formatting Standard Task
    11·2 answers
  • Where can you check effective access on a shared folder? answer?
    11·1 answer
  • Due to the difficult economic times, increased global competition, demand for customization, and increased consumer sophisticati
    9·1 answer
  • A DESKTOP COMPUTER (NAMED WORKSTATION22) CAN'T CONNECT TO THE NETWORK. A NETWORK CARD WAS PURCHASED WITHOUT DOCUMENTATION OR DRI
    14·1 answer
  • What do astronomers call a system that is composed of more than two stars?
    9·2 answers
  • For the following C code assume k and m are passed in x3 and x4 respectively, while result is returned in x4. Compile this code
    14·1 answer
  • Are you absent minded because you are thinking of an online activity?​
    12·1 answer
  • 2.Some artists look for ways to extend copyright for longer than the laws normally allow. Why do they do this?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!