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

Why is rubbing alcohol boiling point lower than cooking oil
what mineral do highly adaptive microorganisms use to convert energy from rocks? a.) carbon, b.) iron, c.) oxygen, d.) sodium
What was the main reason for the war in Iraq?
The region of the globe where the Gulf Stream and other warm water currents originate is known as the _________.
Therapist Charlotte Maley is a behaviorist. She is MOST likely to suggests that depression is: due to unresolved unconscious conflicts. the result of changes i
what was at the core of hitler's ideas
How did Germans feel differently than other Europeans about the war?
which of the following species demonstrates a matriarchal structure? a.) Chinook salmon, b.) gannets, c.) orcas, d.) sea turtles
Last year there were 381 students at Woodland middle this year there are 419 students. What is the percent of change?
which of the following best describes Abigail Adam's view on the role of women in society?