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

john bought 2 boxes of books at a yard sale if each box had 5 books how many books did he buy
Active transport performs which function in a cell? a.packages proteins for export from the cell b. distributes enzymes throughout the cytoplasm c.moves subs
People have little incentive to produce a public good because
What is the hybridization of the central atom in seof2?
What is the hybridization of the central atom in seof2?
In reviewing the accounts receivable, the cash realizable value is $14,000 before the write-off of a $1,800 account. what is the cash realizable value after the
50% of all the cakes jenny baked that week were party cakes, 1/5 were fruits cake and the remainder were sponge cake. what is the percentage of the sponge cakes
How long does it take for an overdose to kill you?
I don't get this problem
A factory worker moves a 30.0 kg crate a distance of 4.50 m along a level floor at constant velocity by pushing horizontally on it. the coefficient of kinetic f