3,714 views
2 votes
2 votes

Which of the following is NOT represented in a subroutine's activation record frame for a stack-based programming language?

  1. Values of local variables
  2. Return address
  3. Heap area
  4. Information needed to access non local variables

3 Answers

2 votes
2 votes
Answer is Heap Area since even if u dynamically allocate a memory region inside a function still that memory area won't be created inside the stack frame of that segment , it would be created in the heap region so even if u exit from the function without freeing the dynamically created node , it would be still persisting in the heap memory region .
2 votes
2 votes

Answer (C)

Heap is a common area for the entire program and is shared across all subroutines / threads of a program.

Each invocation of a subroutine has a record associated with it at runtime, holding some or all of the following:

  • Arguments (parameters)
  • A link to the caller's stack frame (the dynamic link)
  • In a language with nested subroutines, a mechanism for accessing non-locals (Option - D), which could be one of:
    • A static link, or
    • A pointer to the most recent frame at this level, or
    • The whole display
  • The return address (Option - B)
  • Local variables  (Option - C)
  • Copies of callee-save registers, if needed
  • Temporaries
  • Spilled registers

Reference: http://cs.lmu.edu/~ray/notes/subroutineimplementation/

Answer:

Related questions

3 votes
3 votes
2 answers
1
ajit asked Sep 23, 2015
5,168 views
Which of the following is true with respect to Reference?A reference can never be NULLA reference needs an explicit dereferencing mechanismA reference can be reassigned a...
1 votes
1 votes
2 answers
2
ajit asked Aug 15, 2015
2,448 views
If only one memory location is to be reserved for a class variable, no matter how many objects are instantiated, then the variable should be declared asexternstaticvolati...
2 votes
2 votes
4 answers
3
jenny101 asked Jun 25, 2016
4,938 views
The following three 'C' language statements is equivalent to which single statement?y=y+1; z=x+y; x=x+1z = x + y + 2;z = (x++) + (++y);z = (x++) + (y++);z = (x++) + (++y)...
7 votes
7 votes
9 answers
4
pooja14 asked Jun 22, 2016
8,137 views
What is the output of the following C program? #include<stdio.h #define SQR(x) (x*x) int main() { int a; int b=4; a=SQR(b+2); printf("%d\n",a); return 0; }14361820