2 2 votes Consider the following statements: S1 : Static allocation can not support recursive function. S2 : Stack allocation can support pointers but can not deallocate storage at run-time. S3 : Heap allocation can support pointers and it can allocate or deallocate storage at run-time. Which of the above statements are true? a S1 and S2 b S2 and S3 c S3 and S1 d S1, S2 and S3 Compiler Design compiler-design runtime-environment made-easy-test-series + – rahul sharma 5 4.4k views answer comment Share Follow Print See all 5 Comments 5 5 Comments reply Show 2 previous comments surbhijain93 commented Oct 20, 2019 reply Follow flag Someone please answer. 0 0 replyShare ayushi_18 commented Jun 15, 2020 reply Follow flag Ans C Stack allocation supports pointers, true, and with that stack allocation happens when stack function is called ,so, once the function call is over memory is deallocated i.e. deallocation of storage at run time. 0 0 replyShare luc_Bloodstone commented Sep 1, 2020 reply Follow flag I am confused in S2. Can anyone please confirms whether its true or false. 0 0 replyShare Please log in or register to add a comment.
0 0 votes ANS is C FOR S2 int **p = new int*; In this case you reserve a portion of memory for a pointer to int in the heap, but the pointer that can reference such location is still a stack variable. maddy0101 answered Dec 28, 2018 maddy0101 comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes Answer should be D raju paul answered Aug 17, 2019 raju paul comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes Answer D s1s2 s3 all are true Ram Swaroop answered Aug 18, 2019 Ram Swaroop comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes TRUE S1 : Static allocation can not support recursive function. FALSE S2 : Stack allocation can support pointers but can not deallocate storage at run-time. Stack memory is allocated during compilation time execution. This is known as static memory allocation. https://iq.opengenus.org/static-memory-allocation-c/ TRUE S3 : Heap allocation can support pointers and it can allocate or deallocate storage at run-time. scholaraniket answered Dec 27, 2019 scholaraniket comment Share Follow 0 reply Please log in or register to add a comment.