josephcfaucett4975 josephcfaucett4975
  • 12-07-2021
  • Computers and Technology
contestada

Given the snippet of code: int x = 5; int bar(int j) { int *k = 0, m = 5; k = &m; return (j+m); } void main(void) { static int i =0; i++; i = bar(i) + x; } Which variables obtain their memory from the stack? A. iB. jC. kD. mE. x

Respuesta :

qmqqvn2vmm qmqqvn2vmm
  • 12-07-2021

Answer:

Variables j , k , m will be stored in the stack.

Explanation:

Variable x will not be in stack as is it a global variable.

Variable i will not be in stack as is it a static variable.

Variable j will be in stack as is it a local variable in the function.

Variable m will be in stack as is it a local variable in the function.

Variable k , a pointer will be in stack as it is in the function bar locally.

Answer Link

Otras preguntas

Marcy is running for student body president. Which sentence in this excerpt from her campaign speech uses parallel structure? Hi, I’m Marcy! Many of you know me
How many balls are blue when 42357% is red?
What evidence does the author use to support his claim that conditions on slave ships were inhumane? check all that apply?
Then add five pairs of your own explaining their connotative differences
What principle was established by the 1963 supreme court case gideon v. wainwright?
Write down all the even numbers from 30 to 300 how many times will 6 appear
How do you find the measure of angle b?
Why do you think the framers did not include more expressed power ?????
What evidence does the author use to support his claim that conditions on slave ships were inhumane? check all that apply?
What is the side length of a square whose area is 1/64 square miles?