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
Operating systems are designed to work with specific hardware. Which operating system works with Apple computers?
Ghella [55]
2. Mac and to be more precisely, OS X
5 0
3 years ago
Read 2 more answers
How many discussion posts must you complete to meet the Expectations of the replies category
Dennis_Churaev [7]

Answer:

I want to take this time to discuss a few expectations and helpful information about how to participate in the weekly online discussions. You can scroll down the page or use the links here to navigate to each section.  All Discussions can be found by clicking on the Discussions link located on the left-hand side of the course.

Explanation:

Participation in the discussion forums is critical for maximizing student learning in this course, both because your participation is graded and because it's a chance to engage in a dialogue about course material.  In this course, students are required to be a part of an online community of learners who collectively interact, through discussion, to enhance and support the professional performance of each other. Part of the assessment criteria for the course includes evaluating the quality and quantity of your participation in the discussion forum.

The TAS will facilitate student discussions, although they likely will not address every single post. In most cases, they might share a related idea, intervene when the discussion goes off-track, or tie student comments together to help deepen student learning.  Remember, if you have a specific question, pose

3 0
2 years ago
Which process improves the life of a computer?
arlik [135]

maintenance is the answer

3 0
3 years ago
When widgets, or portable chunks of code, are embedded on html pages and thereby help increase the functionality of those pages,
Anna11 [10]
<span>When widgets, or portable chunks of code, are embedded on html pages and thereby help increase the functionality of those pages, consumers embrace one of the greatest virtues of social media known as Collaboration.</span>
5 0
3 years ago
The term eof represents
rewona [7]

Answer:

EOF stands for End Of File

Google explains it well: EOF is a condition in a computer operating system where no more data can be read from a data source. The data source is usually called a file or stream.

8 0
2 years ago
Read 2 more answers
Other questions:
  • What will be returned when the following SQL statement is executed?
    5·2 answers
  • You should use the longest possible shutter speed for all firework photographs.
    8·2 answers
  • <img src="https://tex.z-dn.net/?f=3x%20-%205%20%3D%203x%20-%207" id="TexFormula1" title="3x - 5 = 3x - 7" alt="3x - 5 = 3x - 7"
    12·1 answer
  • A client-server relationship is the basic form of a ____?
    15·1 answer
  • Differentiate among web apps, mobile apps, and mobile web apps.
    14·2 answers
  • How to make changes to a file on the USB drive
    6·2 answers
  • If you will be giving your presentation to an audience, you can practice your presentation by using View, ___________, to rehear
    14·1 answer
  • How has information technology made piracy possible
    14·1 answer
  • Global address list characteristics
    11·1 answer
  • How do I add a Child to my Brainly account
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!