in Programming in C retagged by
5,776 views
26 votes
26 votes

Match the following:$$\begin{array}{|ll|ll|}\hline P. & \text{static char var ;} & \text{i.} & \text{Sequence of memory locations to store addresses} \\\hline  Q. & \text{m = malloc(10); m =NULL ;} & \text{ii.} & \text{A variable located in data section of memory} \\\hline R. & \text{char *ptr[10] ;} & \text{iii.} & \text{Request to allocate a CPU register to store data} \\\hline S. & \text{ register int varl;} & \text{iv.} & \text{A lost memory which cannot be freed} \\\hline\end{array}$$

  1. P-ii; Q-iv; R-i; S-iii
  2. P-ii; Q-i; R-iv; S-iii
  3. P-ii; Q-iv; R-iii; S-i
  4. P-iii; Q-iv; R-i; S-ii
in Programming in C retagged by
5.8k views

1 comment

https://en.wikipedia.org/wiki/Data_segment

some more detail about data section.

0
0

3 Answers

33 votes
33 votes
Best answer

static char var $=$ A variable located in data section of memory

$m= malloc(10); m= null; $ Here, free(m) is missing: So, a lost memory which cannot be freed

$char * ptr[10];$ Sequence of 10 memory locations to store addresses

register int var1; Request to allocate a CPU register to store data

Answer is A.

edited by

1 comment

m= malloc(10); m= null;

Will result in Memory Leak. Similar question: https://gateoverflow.in/635

1
1
2 votes
2 votes
P)ii

Q) iv

R)i

S)iii

Ans: option A.
0 votes
0 votes

answer is A

Answer:

Related questions