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
Vinil7 [7]
3 years ago
5

Consider the code fragment below. Show the values stored at each location in memory and as they change while the code executes.

Use the memory addresses given in the comments following each statement. Assume all integer and pointer sizes are four bytes and each box in the memory representation is 4 bytes.
int x; // x is at memory address 5000
int *y; // *y is at memory address 5004
int *z; // *z is at memory address 5008
int *a; // a is at memory address 5012
z=&x;
y=malloc(5 * sizeof(int)); // malloc returns
// address 6000
X = 10;
y[1] = 15;
y[2] = *z; x=*(y + 1);
a = malloc(sizeof(int)); // malloc returns // address 6020
*a = *y; a = z; *z= 25; *a = 12; y[3] = *z; y[4] = x; y[0] = x;
Computers and Technology
1 answer:
Nana76 [90]3 years ago
6 0

Answer:

see explaination

Explanation:

Final value :-

Memory => value = reference in code

5000 => 12 = x

5004 => 6000 = *y

5008 => 5000 = *z

5012 => 5000 = *a

6000 => 12 = y[0]

6004 => 15 = y[1]

6008 => 10 = y[2]

6012 => 12 = y[3]

6016 => 12 = y[4]

6020 =>

You might be interested in
my headphone jack that is like in the computer will not work only my speakers will work when i plug in
marusya05 [52]

I'm assuming that what you are saying is that while the headphone is plugged in to the computer, it still plays on the computer speakers.

Most likely, the headphone outlet is dirty and need cleaning. To solve this, plug in your headphones into the headphone outlet, and take it out really quickly. Do this for a certain amount of time until it works.

If this does not work, check the settings if you are allowing it to play into external devices or not.

~

3 0
3 years ago
Read 2 more answers
Online arguments that progressively escalate into insults and harsh language where the bully threatens and tries to intimidate a
9966 [12]
█ Explanation <span>█

</span><span>An online argument that progressively escalate into insults and harsh language where the bully threatens and tries to intimidate another person is known as a flame war.

Answer: Choice D

</span><span>Hope that helps! ★ <span>If you have further questions about this question or need more help, feel free to comment below or leave me a PM. -UnicornFudge aka Nadia </span></span>
8 0
3 years ago
Read 2 more answers
It is very easy to change data into charts<br> what is a Microsoft Excel Microsoft Outlook or both​
Vadim26 [7]
It’s microsoft Excel
8 0
3 years ago
List two functions of the UPS​
Alja [10]

Answer:

To protect equipment in the event of power-cut

To ensure stable supply of current (protects against surges)

Explanation:

4 0
3 years ago
You are an administrator for the Contoso Corporation. You have client software that receives its configuration from a shared fol
bija089 [108]
In order to make sure that the shared folder is accessible and the performance is high at all times, it would be best to house it on a secure file sharing/storage services, such as Box or Dropbox.
4 0
3 years ago
Other questions:
  • An objective test or measurement that technology product evaluators use to compare two or more products is ____.
    12·1 answer
  • Write a class that can make comparisons between the efficiency of the common methods from the List interface in the ArrayList an
    5·1 answer
  • 1. Consider the following code segment.
    8·1 answer
  • Consider the following table used for grading assignments.
    10·1 answer
  • User authentication is a procedure that allows communicating parties to verify that the contents of a received message have not
    12·1 answer
  • The _______ system coordinates computer resources, provides the user interface, and runs applications.
    10·1 answer
  • The various protocols in use on the internet are said to operate in layers in which the protocol(s) at each layer solve one prob
    5·2 answers
  • Describing Report Tools Functions
    9·1 answer
  • Item 3
    15·1 answer
  • What are the nuclear codes?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!