Which version of gcc are u using ? I do get a error in 4.3.2 If size of scanf's argument is smaller than format specified, behaviour is undefined. Hence implementation is free to choose a behaviour.
On Tue, Jun 22, 2010 at 3:37 PM, mohit ranjan <shoonya.moare [email protected]>wrote: > i am not getting any seg fault on gcc > > any specific i/p you are giving for scanf ? > > > Mohit Ranjan > > > > On Tue, Jun 22, 2010 at 2:54 PM, sharad <[email protected]> wrote: > >> #include<stdio.h> >> >> int main() >> >> { >> >> char a,b; >> >> printf("%d\n",12); >> >> printf("%d\n",printf("%d",143)); >> >> printf("%d\n",scanf("%2d%3d",&a,&b)); >> } >> y this prog is giving seg fault after all its o/p >> >> -- >> >> 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]<algogeeks%[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]<algogeeks%[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.
