During declaration of static variables.. after assigning memory to all the elements it initialize *ALL THE MEMORY ALLOTTED *members with zero...* *
On Fri, Jul 29, 2011 at 8:09 PM, Arshad Alam <alam3...@gmail.com> wrote: > > Yes I agree static variables initialises with 0 but 0 will be at the very > first position of the array, so what about second, third ... positions of > array..why all those are also 0 but it should be any garbage value... please > clarify it. > > > > On Fri, Jul 29, 2011 at 7:38 PM, sagar pareek <sagarpar...@gmail.com>wrote: > >> 0 0 0 0 0 >> u are taking array static which initialize its elements with zero :) >> >> On Fri, Jul 29, 2011 at 7:38 PM, aditi garg <aditi.garg.6...@gmail.com>wrote: >> >>> 0 0 0 0 0 >>> >>> >>> On Fri, Jul 29, 2011 at 7:35 PM, Arshad Alam <alam3...@gmail.com> wrote: >>> >>>> what would be the output of below program >>>> >>>> #include<stdio.h> >>>> #include<conio.h> >>>> void main() >>>> { >>>> clrscr(); >>>> static int a[5]; >>>> int i; >>>> for(i=0;i<=4;i++) >>>> printf("\n%d",a[i]); >>>> getch(); >>>> } >>>> >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Algorithm Geeks" group. >>>> To post to this group, send email to algogeeks@googlegroups.com. >>>> To unsubscribe from this group, send email to >>>> algogeeks+unsubscr...@googlegroups.com. >>>> For more options, visit this group at >>>> http://groups.google.com/group/algogeeks?hl=en. >>>> >>> >>> >>> >>> -- >>> Aditi Garg >>> Undergraduate Student >>> Electronics & Communication Divison >>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY >>> Sector 3, Dwarka >>> New Delhi >>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to algogeeks@googlegroups.com. >>> To unsubscribe from this group, send email to >>> algogeeks+unsubscr...@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> >> >> -- >> **Regards >> SAGAR PAREEK >> COMPUTER SCIENCE AND ENGINEERING >> NIT ALLAHABAD >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> 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 algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.