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
Green Fields Landscaping Company sells evergreen trees which are priced by height. Customers have a choice of purchasing a tree
Tomtit [17]

Answer:

Answered below

Explanation:

//Program is written in Python programming //language.

number_of_trees = int(input ("Enter number of trees purchased: "))

height_of_trees = float(input("Enter height of trees: "))

delivery_status = input("Do you want trees delivered? enter yes or no ")

price_of_two_meters = 20

total_price = number_of_trees * price_of_two_meters

//Invoice

print (number_of_trees)

print(height_of_trees)

print (total_price)

print (delivery_status)

8 0
3 years ago
Write a program that will add up the series of numbers: 99,98, 97...3.2.1. The program should print the running total as well as
Gekata [30.6K]

Answer:

result = 0

for i in range(99, 0, -1):

   result += i

   print(result)

Explanation:

7 0
3 years ago
What is the shortcut to select all text?
abruzzese [7]
Highlight everything with your curser.
7 0
3 years ago
Read 2 more answers
A company is concerned that hackers may gain access to its computer system or that it may be
lesantik [10]

Answer:

computer virus is an spreading disease in a computer

Explanation

a virus can be spread through many ways by servers , wifi ,and the cloud

so its better to have an safe and secure firewall by your domain or you could use cloud computing to test viruses

it also can spread pretty fast so u better have a good antivirus

4 0
2 years ago
Game design is iterative. What does this mean?
Furkat [3]

Answer:  

What does Iterative Game Design mean?

Iterative game design is the process by which a video game is repeatedly proposed, prototyped, play tested and reevaluated prior to working product release. Iterative game design operates on the following principle: It is unrealistic to create an ideal product on the first try.

By creating and testing working models on core criteria (such as fun), game designers are able to refine product on a gradual basis and increase market success potential.

3 0
3 years ago
Other questions:
  • The management of Ventura Inc. approves the purchase of a few computers for the sales team. The management wants only the most b
    8·1 answer
  • Diane wants to maintain a record of grades scored in the fifth, sixth, and seventh grades. She enters her grades and the total p
    13·1 answer
  • The ____ category of apps makes the computer easier for blind people to use.
    9·1 answer
  • Marissa bought 2 and 1/2 gallons of orange juice to make punch how many quarts of orange juice did Marissa Buy
    15·2 answers
  • Why it’s important to keep the standard internet protocol TCP/IP?
    11·1 answer
  • What will be the value of ans after the following code has been executed?
    10·2 answers
  • Why a management-focused program provides a more appropriate learning path for you than a program based heavily on technical con
    8·1 answer
  • with the advent of technology one can experience special features such as 3D theater experiences true or false
    8·1 answer
  • Why do we need operating systems?
    7·1 answer
  • You hide three worksheets in a workbook and need to unhide them. How can you accomplish this?.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!