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
How prevalent is licensing for software engineers in the United States
Liono4ka [1.6K]

Answer:

Software Engineering is now a profession that needs a license in the US, and in most of the states, the total being almost 40 out of all where you need the license. And there are various forms of requirements like certification programs and the degrees as well as professional ethics, professional associations and government licensing. It's certainly a licensing discipline now in Texas, out here in the US.

Explanation:

Software Engineering is now a profession that needs a license in the US, and in most of the states, the total being almost 40 out of all where you need the license. And there are various forms of requirements like certification programs and the degrees as well as professional ethics, professional associations and government licensing. It's certainly a licensing discipline now in Texas, out here in the US.

And most recent dates it has been given the definition, that both the Engineering and Computer Science are being involved, their principles, practices for the designing and the development of various software applications. Failure can be deadly, and this is the main reason why this step has been taken ACM, IEEE, APEGBC and the ICCP have been up with the professional code of ethics.

However, if you have a Degree or a certification, you need not worry. You are already licensed then.

5 0
3 years ago
In a black box model are the customers told that they should be expecting to be haxked?
Licemer1 [7]
Uhhhhhhhhhhh maybe tbh i have noooo idea.
6 0
3 years ago
g A sign of thrashing is Group of answer choices the CPU utilization increases as the degree of multiprogramming is increased. t
Bezzdna [24]

Answer:

the CPU utilization decreases as the degree of multiprogramming is increased.

Explanation:

The fundamental concept is that allocating a process with too few frames causes too many and frequent page faults. This implies that the CPU does not perform any useful work and thus its utilization would decrease drastically. In this case, the long-term scheduler, in a bid to improve the utilization of the CPU, would load more processes into the memory so as to increase the extent of multiprogramming. As a result, there would be more decrease in the utilization of the CPU, leading to a chained reaction of higher page faults, which is then followed by a corresponding increase in the multiprogramming degree, usually known as thrashing.

8 0
3 years ago
Which of the following is true about occupations within the STEM fields? Many occupations use mathematics, even if it is not the
Kazeer [188]

Answer:

Many occupations use mathematics, even if it is not the primary focus of a given job.

Explanation:

Think about software developers, they develop apps, websites, and other things, but they also use math in the process. Scientists use statistics. Mechanics use math to make sure their measurements are right. Therefore, I think your best bet would be

A. Many occupations use mathematics, even if it not the primary focus of a given job.

8 0
3 years ago
Read 2 more answers
Which software is used to play, create, and modify audio and video files?
Alenkasestr [34]
Windows Movie Maker, iMovie, Final Cut Pro (x), QuickTime?
8 0
3 years ago
Read 2 more answers
Other questions:
  • A network engineer is examining a configuration implemented by a new intern who attached an ip phone to a switch port and config
    9·1 answer
  • A senior center would like to add a new computer to their library so that members can check their email and read book reviews
    11·2 answers
  • Which of the following statements is false? a. InputStream and OutputStream are abstract classes for performing byte-based I/O.
    7·1 answer
  • Machu Picchu is located in modern day _______<br><br>​
    14·2 answers
  • At what x position are the ellipses drawn??? thanks ♡​
    6·1 answer
  • Your network has four Hyper-V hosts, which are running three domain controllers and about 10 member servers. Three of the member
    10·1 answer
  • Edhesive 3.4 practice 1
    9·1 answer
  • One limitation of high-level programming languages is
    10·1 answer
  • What product use programmable control?
    11·1 answer
  • Consider that a man is watching a picture of a Black Horse. He receives an external stimulus from input channel. Man gains some
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!