example for function returning pointer in c:
What is the output of below c program?
int *p = fun();
compile time error
run time crash
no error, no crash, but garbage value will be printed.
This is an example where memory allocated by function is returned to the pointer, and in that address we are pasting value 100. So when we print the value at that locaion returned by address it gives 100.
Back To Top