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

Noah developed a model of how genes are acquired by offspring in sexual reproduction. He used two baskets-one to represent each parent. He placed two slips of p
PLEASE HELP, QUESTION IN THE PICTURE ​
Simplify. 8.4c-4.3c.
can anyone please help me? (pic attached)
Noah developed a model of how genes are acquired by offspring in sexual reproduction. He used two baskets-one to represent each parent. He placed two slips of p
2 m 2 m What is the volume of the composite figure? 2 m 2 m 5m 3 m 2 m V = [?] m³ 3 4 Enter
ii The firefighter slides through the vertical pipe with length h=15m. Its potential energy at the top is 1000J. Sketch a graph showing how the potential energy
What is linguistic bias?
Please help I was sick and missed out on class.Thank you
A square root function has a domain of x≥15 and a range of y≤10. What is the range of its inverse? y≤10 x≤15 x≥10 y≥15