I started studying pointers and I got in some trouble with the next code:
#include <stdio.h>
int * g()
{
int a = 10;
return &a;
}
void main()
{
int *p;
p=g();
printf("%d",*p);
}
It returns the error segmentation fault. core dumped
I would really apreciate any help. Have a nice day!