Output on gcc 4.3.x being bfed75a8 3 -1218278705
The First output is the address of the a[0] . Here the function is returning a local address , so the output is compiler dependent . On Tue, Jul 19, 2011 at 8:42 PM, geek forgeek <[email protected]> wrote: > @schrodinger y a[] value is not lost in first call.it should be lost in > first call only? > > > On Tue, Jul 19, 2011 at 8:24 PM, schrodinger <[email protected]>wrote: > >> First output of memory location is fine. >> Second output is also expected one. >> Third output will vary compiler to compiler and from time to time. >> >> This is because a[] is a local to fun(). First time when you call >> printf("%d\n",r[0]) its fine. but after executing printf() location of r is >> lost and hence you'll get different output is undefined. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/algogeeks/-/gzaXX7gzytAJ. >> >> 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. > -- Regards Rajeev N B <http://www.opensourcemania.co.cc> -- 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.
