This happens because 'd' is automatically cast into type 'size_t' which is basically unsigned int type. So, it compares ffffffff with TOTAL_ELEMENTS. Explicitly cast it into int, if you want it to work!
On Jun 25, 3:23 pm, harshit pahuja <hpahuja.mn...@gmail.com> wrote: > #include<stdio.h> > #define TOTAL_ELEMENTS (sizeof(array) / sizeof(array[0])) > int array[] = {23,34,12,17,204,99,16}; > int main() > { > int d; > for(d=-1;d <= (TOTAL_ELEMENTS-2);d++) > printf("%d\n",array[d+1]); > return 0; > > } > > y der is nothing in the output ????..... > > - > Regards - > HARSHIT PAHUJA -- 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.