I wrote a simple program in C (newbie in C)
when i try to compile this program it's get compiled.
created pointer to int 'p' and store the address of of variable 'a'
when i derefernce the pointer it show the value 0 but i never assigned any value
to my variable so where does 0 come from ?
and if we write
int a;
it allocates space in the memory even before assigning any value to it.
#include <stdio.h>
int main()
{
int a;
int *p = &a;
printf("%d\n", *p);
return 0;
}
compiler : clang