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 <[email protected]> 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 <[email protected]>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 <[email protected]>wrote: >> >>> 0 0 0 0 0 >>> >>> >>> On Fri, Jul 29, 2011 at 7:35 PM, Arshad Alam <[email protected]> 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 [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. >>>> >>> >>> >>> >>> -- >>> 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 [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 >> 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 [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 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 [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.
