error due statement int*y; because it tries to allocate another pointer being uninitialized .It may happen that garbage address which was given to x is also try to give to y . This makes program crash ... You can check it by making *y=1000; sttmnt as comment and run after that comment both statement int*y; and *y=1000; . You will see what happen.
On 16 September 2011 00:07, vikas singh <[email protected]> wrote: > > > On Thu, Sep 15, 2011 at 11:54 PM, SAMMM <[email protected]> wrote: > >> I think u haven't ran the the code or compile it .. It give the output >> as 1000 10 ......... >> >> >> @SAMM : Dude, seg fault on g++ > > >> Check tht .. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> >> > > > -- > Thanks and Regards > VIKAS SINGH > MCA- final year > NIT DURGAPUR > email: > [email protected] > [email protected] > http://smrit.wordpress.com > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- **With Regards Deoki Nandan Vishwakarma * * -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
