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
In which client/server relationship can a computer act as both a client AND a server? Select one: a. X-Windows b. SSH c. Classic
Ivanshal [37]

Answer: d) Peer-to-Peer

Explanation:

Peer-to-peer(P2P) is the the system in which computer system are linked with reach other through internet connectivity. There is no requirement of central server for file sharing and transmission. Thus, it can act as client and file server in a network for file and data transmission.

  • Other options are incorrect because classic view,X-Window and SSH(Secure Shell) are not the relationships that have the potential to behave as client and server for cooperation of programs.
  • Thus, the correct option is option(d).
3 0
3 years ago
Mike needs to write the primary objectives of a project in a project plan. In which section should he write them?
pochemuha
D because you are always supposed to use your schedule
5 0
3 years ago
Why is a personal laptop computer NOT a server?
bixtya [17]
I believe the answer is C) <span>servers are used directly by computers, not by people

Have a good day! =)</span>
4 0
3 years ago
Read 2 more answers
Examine about the Internal &amp; External Fragmentation methods give an example for each. essay​
Tju [1.3M]

Internal Fragmentation occurs when a process needs more space than the size of allotted memory block or use less space. External Fragmentation occurs when a process is removed from the main memory. Internal Fragmentation occurs when Paging is employed. External Fragmentation occurs when Segmentation is employed.

3 0
3 years ago
What happens when your project is rendered?
jok3333 [9.3K]

Answer:

B

Explanation:

when your rendering video project your computer is processing all the data that goes into creating images you experience video rendering every time you look at your computer the images on your screen has all been rendered to produce the website photo or video you are looking at

4 0
2 years ago
Other questions:
  • Write a calculator program that keeps track of a subtotal like real calculators do. Start by asking the user for an initial numb
    12·1 answer
  • I have a problem with Instagram.
    11·1 answer
  • The first few lines of a script that say "using" ... that point the code to the right groups are called
    11·1 answer
  • Set methods are also commonly called _____ methods, and get methods are also commonly called _____ methods.
    6·1 answer
  • What can you find the under the privacy policy section of a shopping website?
    12·1 answer
  • Select the correct answer.
    15·2 answers
  • What is the first step a user should take toward generating an index?
    7·1 answer
  • Lucia is using the American Psychological Association (APA) style guidelines to writer her research paper. What is her most like
    5·2 answers
  • What is output?<br> x = 2<br> y = 3<br> print (x * y + 2)<br> 4<br> 2<br> 8<br> 10
    7·1 answer
  • How many pages is 1500 words double spaced 12 font?.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!