Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Your top-ten linux desktop apps

Erik de Castro Lopo wrote:

You will notice that something like the Array.mapi function is
much less likely to contain errors than the C for loop.
I can modify my C-program to remove that problem in the ff. So,
as to whether a C-program is more prone to error relies on the
manner and style of coding and not intrinsic to C-language. Don't
you think ?

#include <stdio.h>

int integer_array[] = {1,-2,3,-4,5,-6,-7,8,-9,32727000};
int *ptr, *past_end, *iptr;

int main(void)
ptr = &integer_array[0];
iptr = ptr; printf("\n\n");

past_end = integer_array + sizeof(integer_array)/sizeof(int);
while (ptr < past_end)
printf("integer_array[%d] = %d ",(ptr - iptr),*ptr);
return 0;

O Plameras