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

I need Maze Runner quotes and the page number that goes with i
the area of a rectangular mirror is 11 11/16 square feet. The width of te mirror is 2 3/4 feet. if there is a 5 foot tall space on the wall to hang the mirror,
Wendall and Sarah are taking road trips. Wendall travels for 15x miles per hour for x hours. Sarah travels for 6 more hours than Wendall at a speed that is 8 mi
1. Amanda weighs 48 pounds (lbs). The physician ordered a drug that is delivered in the proportion of milligrams (mg) of medication to kilograms (kg) of body we
What is the cultural context of the waltz? (Dance)
moving from coastal to interior regions of sub-saharan we discover that the dominant physical geographic feature is
a concert ticket that originally cost $18.50 is on sale for $14.00 what is the percent of decrease,rounded to the nearest tenth?
I want to know what 5 to the negative second power is
A 200 kg object is going 4m/s. Find its kinetic energy
filtering occurs when _____.