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
If data from a DOS system is electronically sent to an EHR or other Windows-based system via an interface to populate an indexed
ra1l [238]

Answer:

yes ! you can see below.

Explanation:

EHR is a health record of a patient that gives information about the patient and securely authorized it. Electronic Health record allows medical professionals to enter data and update a new encounter.

DOC is a document used by Microsoft. DOC file is a file that contains formatted text, images, tables, graphs, and charts, etc.

Unstructured data is data that can be entered in free text format. Structured information is a type of data contain check boxes, images table, and other the user chooses from the given option.

As the DOC system contain free text format, then data in the EHR is structured.

8 0
3 years ago
What can happen if you do not follow the directions of medicine or the directions from the doctor? (Give 4 examples)​
iren [92.7K]

Answer:

1) Issue at hand will not properly be resolved and another visit to the doctor will have to occur, either to refill the prescription or to try another course of action.

2) Side effects

3) Ineffective

4) If directions are not followed to a tea, money will be waisted on the purchase.

Explanation:

5 0
3 years ago
To share a server folder, access the ____ tab in the folder properties dialog box and click the share button (or from the window
anygoal [31]
Oh lord I have no idea :/ I suck at this yeah idk
5 0
3 years ago
The___is a waterproof fabric that is placed around your camera
Zina [86]
Can you help me with homework and the answer is a circle
5 0
3 years ago
Computer identity theft differs from theft in the real world in what major way?
CaHeK987 [17]

Answer:

The answer is B

5 0
3 years ago
Read 2 more answers
Other questions:
  • What precaution can you take while using a social networking site to prevent a data breach?
    15·1 answer
  • Which of the following is a Microsoft solution that runs on a Microsoft Terminal Services server but appears, to end users, as i
    10·1 answer
  • Derek has an interest in designing video games. What requirements should he fulfill to be a game designer?
    13·1 answer
  • Typically, a dvd has how many times more capacity than a cd?
    5·1 answer
  • Write a program that takes the radius of a sphere (a floating-point number) as input and then outputs the sphere’s: Diameter (2
    7·1 answer
  • E-mail has made it very easy to send a message to more than one person at any time of day from just about anywhere. If you wante
    12·2 answers
  • Which key is used to indent the first line of a paragraph to the right?
    15·2 answers
  • An HTML document is composed of ______ that represent distinct items in the Web Page, such as a paragraph, the page heading, or
    9·1 answer
  • During which phase of the website transformation processwould the project team for developing perform content analysis, layout t
    13·1 answer
  • which one of the following would not normally be found in an organization's information security policy?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!