6 votes 6 votes Rohan Mundhey asked Nov 5, 2016 • edited Nov 5, 2016 by Kapil Rohan Mundhey 383 views answer comment Share Follow See 1 comment See all 1 1 comment reply neha soni commented Nov 5, 2016 reply Follow Share please explain the output of this program 0 votes 0 votes Please log in or register to add a comment.
Best answer 5 votes 5 votes Here, in the function *f() , Variable J has been allocated memory in the runtime on heap and hence returned value J is not lost. Hence, value of J is returned and pointer variable is initialized with 10 This program snippet simply prints the value 10. Kapil answered Nov 5, 2016 • selected Nov 6, 2016 by Rohan Mundhey Kapil comment Share Follow See all 2 Comments See all 2 2 Comments reply Arjun commented Nov 6, 2016 reply Follow Share Well, technically it can cause compile time error- header file missing for malloc,printf 1 votes 1 votes Kapil commented Nov 6, 2016 reply Follow Share Yes, Sir you are right :D 0 votes 0 votes Please log in or register to add a comment.