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
Courts are struggling with the privacy implications of GPStracking. In 2009, New York’s highest court held that policeofficers m
aniked [119]

Answer:

warrant

Explanation:

New York State's highest court ruled in 2009 that tracking a person via the global positioning system (GPS) without a warrant violated his right to privacy.

6 0
3 years ago
Concept tests in the screening and evaluation stage of the new-product process rely on written descriptions, sketches, or mock-u
pochemuha

Answer:

The answer is "Actual products".

Explanation:

The key purpose of this research is to better analyze the concepts, which is done to establish customer buying expectations and perceptions of the item. The key point is to assess the consumers ' initial response to the product idea.

  • This concept testing is also known as a creation, it is an advantage, which can be conveyed to the user to test their reactions.  
  • In conceptual testing, it is a quality check between the design definition and the actual production of the product.

6 0
3 years ago
¿Cómo las ciencias sociales y la tecnología han modificado tu comunidad?
sergeinik [125]

Answer:

La ciencia y la tecnología han tenido un gran impacto en la sociedad y su impacto está creciendo. ... Al hacer la vida más fácil, la ciencia le ha dado al hombre la oportunidad de perseguir preocupaciones sociales como la ética, la estética, la educación y la justicia; crear culturas; y mejorar las condiciones humanas.

4 0
3 years ago
How many lines of text are in your questionnaire document
wel

Answer:

*9* lines - I think.

Explanation:

8 0
3 years ago
Learning Task 5. Identify the terms being described below. Write your answer in your answer
Charra [1.4K]

Answer:

1. Waste management.

2. Substitution.

3. Personal hygiene practices.

4. Emergency preparedness.

5. Elimination.

6. Flammability limit.

7. Occupational safety and health (OSH).

8. Engineering controls.

9. Personal protective equipment (PPE).

10. Administrative controls.

Explanation:

1. <u>Waste management</u>: this refers to the collection, transportation, processing or disposal, managing and monitoring of waste materials.

2. <u>Substitution</u>: this refers to the hazard control which involves the measure of replacing one hazardous agent or work process with less dangerous one.

3. <u>Personal hygiene practices</u>: a very important method of controlling hazards which involves proper washing of your hair, skin, body and even your clothes.

4. <u>Emergency preparedness</u>: this refers to the preparedness for the first and immediate response in case of any type of emergency.

5. <u>Elimination</u>: this hazard control refers to the removal of a specific hazard or hazardous work process.

6. <u>Flammability limit</u>: is the term used to call the range of concentration over which a flammable vapor mixed with air will flash or explode if an ignition is present.

7. <u>Occupational safety and health (OSH)</u>: a cross-disciplinary area concerned with protecting the safety, health and welfare of people engaged in work or employment.

8. <u>Engineering controls</u>: the term used in hazard control which involves changing a piece of machinery or work process.

9. <u>Personal protective equipment (PPE)</u>: the term used to call any piece of equipment which is used to protect the different parts of the body such as ears and eyes such as respirators, face mask, face shield, gloves, boots, etcetera.

10. <u>Administrative controls</u>: this is a form of hazard control which involves manipulation of worker/employee’s schedule and job rotation.

7 0
3 years ago
Other questions:
  • After you enter the details for the first selected recipient in the New Address List dialog box, click _______ to add another re
    11·2 answers
  • Which is the output of the formula =AND(12&gt;6;6&gt;3;3&gt;9)
    6·1 answer
  • Camera shock might happen if you do which of the following to your camera?
    6·2 answers
  • What are the features of Cobol language that make it suitable for programming business applications.
    6·1 answer
  • Which of the following answers refers to a system containing mappings of domain names to various types of data, such as numerica
    15·1 answer
  • The incompatibilities in speed between the various devices and the CPU make I/O synchronization difficult, especially if there a
    6·1 answer
  • Determine the following information about each value in a list of positive integers.
    14·1 answer
  • PLLZZZZZ HELP I WILL GIVE BRAINLIEST IF ANSWER IS RIGHT
    14·2 answers
  • Think of some local businesses that have websites. Look online and identify two different websites for businesses or services in
    11·1 answer
  • What method is used in the following line of code to associate clicking the left button with the event handler "clickSingle"?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!