--- In [email protected], wang jun <[EMAIL PROTECTED]> wrote: > > Hi Debasish, > > I am using gcc in ubuntu. once I remove n in the arr[ n ] > int arr[ ] = { 1, 2, 3, 4, 5 } > it complies without warning. > Or > int arr[ 6 ] = { 1, 2, 3, 4, 5 }, > this complies as well. > > So I think there should be a null at the end of array. > > Regards, > Wang Jun > > On Fri, 2007-11-02 at 17:29 +0000, debasish deka wrote: > > Hello all, > > Recently I read in some topic about C99 - modifications to > > ANSI C. That it had facility for runtime varying array > > compatibility. So I tried this short program on DevC++. But > > it was full with warnings > > int main(int argc, char *argv[]) > > { > > int n = 5; > > int arr[n] = {1,2,3,4,5}; > > while(n--) > > printf("\nelement is %d\n",arr[n]); > > system("PAUSE"); > > return 0; > > }
Usually compilers will give warnings when using "advanced" features. Have you invoked the compiler with the necessary compiler options to turn off warnings for these C99 features? And what warnings have you got exactly? Regards, Nico
