The following code :
int *a;
*a = 5;
will most likely result in a segmentation fault and I know why.
The following code :
int a;
*a = 5;
won't even compile. (gcc says : invalid type argument of unary *).
Now, a pointer is simply an integer, which is used for storing an address. So, why should it be a problem if I say :
*a = 5;
Ideally, this should also result in a segmentation fault.