sizeof returns size_t values and size_t is "typedef unsigned int
size_t;"
but when you compare it with -1(int) ,d=-1 is converted to unsigned
int
which becomes very large (INT_MAX)
and d (INT_MAX) > 7 so the loop is never executed.

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.

Reply via email to