int *p;
p=0;
*p=12;
Since p is a pointer to int, "p=0" is setting the pointing address to 0 (why?).
Then with "*p=12", you're setting the value 12 on the address p (on 0).
Since that address isn't yours it will probably produce a segmentation fault.
Edit: A program is not assigned to use everything in RAM. There are other programs in RAM as well. If a program tries to edit another program's address it produces a seg error because you it's "illegal" to edit other programs' data. In theory, you could edit everything you want in RAM, but the problem is, OS doesn't allow it. You can only edit addresses that that are yours (what you have declared or allocated).
Also afaik, the address 0 is reserved for a 'null pointer'. So the objects that point to 0 are assumed to point to 'nothing'. You can think of it as a 'resting place' for pointers. Those pointers who don't want to point to anything just point to 0.
Thus even though there is an address 0, you're not supposed to edit it. It's OS protected.