run time error because pointer is not assigned a address and it will be pointing to some junk location so *x = 1000 will result in a run time error
On Thu, Sep 15, 2011 at 11:32 PM, SAMMM <[email protected]> wrote: > #include<cstdio> > #include<iostream> > using namespace std; > > int main() > { > int w=10; > int *p=&w; > int *x; > *x=1000; > int *y; > *y=100; > printf("%d %d %d",*x,*p,*y); > return 0; > } > > > Wht is the o/p ?? > > 1)1000 10 100 > 2)1000 10 10 > 3)Compilation Error > 4)Run Time Error > > -- > 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. > > -- 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.
