• recategorized by
705 views
2 2 votes

In Run Time Environment, which of the following is stored in heap?

  1. Static variables declared inside a function.
     
  2. Dynamic allocated array of integers created using malloc.
     
  3. Return address of function.
     
  4. An array of integer declared inside a function.

1 Answer

2 2 votes

 

A) False, static variables stored in data section.

B) True ,heap is the portion of memory where dynamically allocated memory resides (i.e. memory allocated via malloc.)

C) False, Return addresses are stored in Stack not in heap.

D) False, it is also stored in stack Section not in heap.

Answer: $B$

• edited by
Answer:
Position:
Show:

Related questions

1 1 vote
2 2 answers
910
910 views
GO Classes asked Feb 10
910 views
$\text{P1:}$int a = 5; int main() { int a = 7; return 0; }$\text{P2:}$int main() { int a = 5; int a = 7; return 0; }$\text{P3:}$int main() { int a...
3 3 votes
2 2 answers
881
881 views
GO Classes asked Feb 10
881 views
$\text { Consider the following program : }$int main( ) { int *ptr, a, b, c; a = 5; b = 11; c = 20; ptr = &a; *ptr = c; ptr = &c; a = *(&b); c = *ptr - a; printf("%d", c)...
2 2 votes
1 1 answer
609
609 views
GO Classes asked Feb 10
609 views
$\text { What will be the maximum value returned by function fun? }$int fun(start, end) { len = end - start + 1; if (len < 1 || end < 0 || start < 0) return 0; if (len % ...
6 6 votes
3 3 answers
2.0k
2.0k views
GO Classes asked Feb 13
2,041 views
Given that Maximum Segment size is $2 ~\mathrm{KB}$ and the slow start threshold (ssthresh) is $16 ~\mathrm{KB}$, how many transmission round is required to reach in cong...