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
Phoenix [80]
3 years ago
8

5. Write few lines of code that creates two arrays with malloc. Then write a statement that can create a memory leak. Discuss wh

y you think your code has a memory leak by drawing the status of the memory after you use malloc and the line of the code you claim that creates a memory leak.
Computers and Technology
1 answer:
Darina [25.2K]3 years ago
3 0

Answer:

 // function with memory leak  

void func_to_show_mem_leak()  {  

int *pointer;

pointer = malloc(10 * sizeof(int));

*(pointer+3) = 99;}  

 

// driver code  

int main()  

{  

    // Call the function  

   // to get the memory leak  

   func_to_show_mem_leak();  

     return 0;  }

Explanation:

Memory leakage occurs when programmers allocates memory by using new keyword and forgets to deallocate the memory by using delete() function or delete[] operator. One of the most memory leakage occurs by using wrong delete operator. The delete operator should be used to free a single allocated memory space, whereas the delete [] operator should be used to free an array of data values.

You might be interested in
Alejandra is using a flash drive that a friend gave to her to copy some financial records from the company database so she can c
Misha Larkins [42]

Answer:

maybe threat?

Explanation:

4 0
3 years ago
In the mouse properties Window, you Can
Dovator [93]
Change different options and settings to make your mouse pointer cooler. Like the buttons work, pointer looks, pointer works, wheel works and more.<span><span /></span>
4 0
3 years ago
What do you hope that people see in your digital footprint 5 years from now? ​
nikdorinn [45]

Answer:

I hope they see me playing with my dog (who died a few months ago) Malikeye

Explanation:

none :)

5 0
2 years ago
b. Suppose instead that Miller had written a routine to constantly change his assigned IP address to other addresses used by his
amm1812

Answer:

It wouldn't be legal practice of SLS’

Explanation:

The Internet service address is the address of the internet where we getting the address of the internet sometimes it is known as the computer address of the host machine.  

Since the miller has changed the Ip address continuously in a constant manner also the other address which is giving by the internet service provider  The transfer of IP address, Miller will be able to receive their network. That sort of practice is not legal of SLS.

5 0
3 years ago
A _____________ is designed for a individual user.
pishuonlain [190]

Answer:

i don't know it sorry

Explanation:

7 0
3 years ago
Other questions:
  • Hard drives are usually self-contained, sealed devices. Why must the case for the hard drive remain sealed closed?
    8·1 answer
  • The part of the computer that contains the brain or central processing unit is also know as the
    15·2 answers
  • How could a system be designed to allow a choice of operating systems from which to boot? What would the bootstrap program need
    14·1 answer
  • Your computer will organize files into
    6·2 answers
  • What should be used to keep a tablet dry?
    13·1 answer
  • Retype and run, note incorrect behavior. Then fix errors in the code, which should print num_stars asterisks.
    9·1 answer
  • Each sentence in the paragraph below has a number. Choose the number of two sentences that are in the wrong order in this story.
    14·1 answer
  • What explains the discrepancy between the number of bytes you can
    13·1 answer
  • Even though jdoe and jrock have the same password (i.e., hacker), their password hashes in the /etc/shadow file are different. W
    15·1 answer
  • How to create create a database in mysql using clv files
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!