Given a code skeleton as follows: int a = 1; char* p; int main() { int i; p=(char*)malloc(100); i = f1(a, p[99]); Time left 1:31:54 } After the code is compiled and launched by the user, the OS will create the address space for this process, based on your understanding of the code and its execution, answer the following questions: segment of the process' address space, while the instructions of the 1. Variable a is stored in the process are stored in the segment, i is stored in the segment of the process' address space. segment, and p[99] is stored in segment of the address space 2. For variable p, it is stored in the called, variable p[99] is copied into 3. There is(are) total process(es) created by the OS when the above program is launched. data stack text|heap data stack text|| heap data stack text|heap data stack text heap segment of the process' address space, when function f1 is ?

icon
Related questions
Question
Given a code skeleton as follows:
int a = 1;
char* pi
int main() {
int i;
p=(char*)malloc(100);
i = f1(a, p[99]);
}
After the code is compiled and launched by the user, the OS will create the address space for this process, based on your understanding of
the code and its execution, answer the following questions:
1. Variable a is stored in the
process are stored in the
2. For variable p, it is stored in the
called, variable p[99] is copied into
3. There is (are) total
segment, i is stored in the
segment of the process' address space.
segment, and p[99] is stored in
segment of the address space
process(es) created by the OS when the above program is launched.
data stack text heap data stack text heap
Time left 1:31:54
data stack text heap data stack text heap
segment of the process' address space, while the instructions of the
segment of the process' address space, when function f1 is
?
Transcribed Image Text:Given a code skeleton as follows: int a = 1; char* pi int main() { int i; p=(char*)malloc(100); i = f1(a, p[99]); } After the code is compiled and launched by the user, the OS will create the address space for this process, based on your understanding of the code and its execution, answer the following questions: 1. Variable a is stored in the process are stored in the 2. For variable p, it is stored in the called, variable p[99] is copied into 3. There is (are) total segment, i is stored in the segment of the process' address space. segment, and p[99] is stored in segment of the address space process(es) created by the OS when the above program is launched. data stack text heap data stack text heap Time left 1:31:54 data stack text heap data stack text heap segment of the process' address space, while the instructions of the segment of the process' address space, when function f1 is ?
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer