I am afraid both of you are incorrect.. 1. since the code modified by you will compile but give sigsegv anyway. 2. The statement " *p = 0; " has nothing to do with the " random address" you are talking about.
On Mon, Dec 17, 2012 at 7:25 PM, Prakhar Jain <jprakha...@gmail.com> wrote: > You are initialising random memory address with 0, which OS doesn't allow. > > On 12/17/12, Shubham Sandeep <s.shubhamsand...@gmail.com> wrote: > > how does this code achieve SIGSEGV???? > > code: > > *p;main(){*p=0;} > > > > -- > > Regards, > > SHUBHAM SANDEEP > > IT 3rd yr. > > NIT ALD. > > > > -- > > > > > > > > > -- > -- > Prakhar Jain > IIIT Allahabad > B.Tech IT 4th Year > Mob no: +91 9454992196 > E-mail: rit2009...@iiita.ac.in > jprakha...@gmail.com > > -- > > > -- - Saurabh Paliwal B-Tech. Comp. Science and Engg. IIT ROORKEE --