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
Drag the tiles to the correct boxes to complete the pairs.
inessss [21]
<h2>Answer:</h2><h2>Releases a new video of its new high - tech manufacturing facility; To create a customer alert about a new program. </h2>

<h2>2)Hosts an online sweepstakes. .....;To increase brand loyalty </h2>

<h2>3)Gives bloggers.....:To give customers a peek into its operation.</h2>

<h2>4)Asks customers to determine their. .....;To allow customers to be part of the product development. </h2>

8 0
3 years ago
When molten igneous material intrudes into rock _____ metamorphism can occur.
Gnom [1K]
B) Contact metamorphism can occur.
8 0
3 years ago
Which single OSPF network statement will correctly include all the interfaces on a device whose IP addresses only begin with a 1
tester [92]

Answer:

network 10.10.8.0 0.0.3.255 area 0

this will include all the interfaces on a device whose IP addresses only begin with a 10.10.8, 10.10.9, 10.10.10, or 10.10.11.

Explanation:

<em>show ip ospf interface </em>

<em>show ip ospf interface brief</em>

these commands are used to display the interfaces that have been enabled into local ospf . it also shows explanation about them by brief command mentioned above.

<em />

4 0
3 years ago
BRAINLIEST!!!!!!!!!!!!!!
Contact [7]

Answer:

Open

Explanation:

Trust

6 0
2 years ago
Read 2 more answers
___ allow users to select controls by keyboard shortcuts. (Points : 3) Alternative keys
PtichkaEL [24]

Answer: Alternative key

Explanation:

 The alternative key is the type of shortcut key in the keyboard that allow the users for selecting the control or shift key. It is also considered as the modifier key. For using the alternative key we must ensure that the lock num is ON in the keyboard.

The alternate key is basically provide the various alternative input and the operation. The short name of the alternate key in the keyboard is denoted as "Alt key". The function of the alternative key may vary from one application to another.    

3 0
3 years ago
Other questions:
  • The analog signals that carry analog or digital data comprise composites built from combinations of simple sine waves.
    12·1 answer
  • Alonzo collects bugs. He has created a fascinating display of large insects. Collecting bugs is a(n) _____ to Alonzo.
    10·2 answers
  • Which fingers should you use to type the reach keys?
    12·1 answer
  • Write a MIPS assembly language program that accomplishes the following tasks:The program will prompt the user to enter an intege
    7·1 answer
  • A real-world problem that might be explained or predicted through the creation of a computer simulation
    7·1 answer
  • g If a class named Student has a data member named gpa , and one of its member functions has a parameter also named gpa , how ca
    7·1 answer
  • A small business has suffered from a cyber attack, what could be the resultant damage​
    10·1 answer
  • What should be done if a system cannot boot from the hard drive?
    14·1 answer
  • Piers wants to take a course on XML. He is a certified web designer, but he has not used XML before. How can he use XML to impro
    8·1 answer
  • The process of learning by making mistakes and by trial and error is called _____.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!