I am trying to return pointer from a function. But I am getting segmentation fault. Someone please tell what is wrong with the code
#include<stdio.h>
int *fun();
main()
{
int *ptr;
ptr=fun();
printf("%d",*ptr);
}
int *fun()
{
int *point;
*point=12;
return point;
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…