2 votes 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 asked Jan 24, 2018 • edited Mar 4, 2019 by ajaysoni1924 rahul sharma 5 3.0k views answer comment Share Follow See all 5 Comments See all 5 5 Comments reply Show 2 previous comments surbhijain93 commented Oct 20, 2019 reply Follow Share Someone please answer. 0 votes 0 votes ayushi_18 commented Jun 15, 2020 reply Follow Share 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 votes 0 votes luc_Bloodstone commented Sep 1, 2020 reply Follow Share I am confused in S2. Can anyone please confirms whether its true or false. 0 votes 0 votes Please log in or register to add a comment.
0 votes 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 See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Answer should be D raju paul answered Aug 17, 2019 raju paul comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Answer D s1s2 s3 all are true Ram Swaroop answered Aug 18, 2019 Ram Swaroop comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 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 See all 0 reply Please log in or register to add a comment.