i have written code to print array rain[3][5], the code is like this:
but i get a error "invalid use of array with unspecified bounds" for "printf("%5.1f",a[d][d1]);" statement. what is the problem? thanksCode:#include<stdio.h> void f1(float a[][],int c); int main(void) { int a; float *b; static float rain[3][5]={ {10.2,8.1,6.8,4.2,1.5}, {10.2,8.1,6.8,4.2,1.5}, {10.2,8.1,6.8,4.2,1.5}}; f1(rain,3); system("pause"); return 0; } void f1(float a[][],int c) { int d,d1; for (d=0;d<c;d++) { for(d1=0;d1<5;d1++) printf("%5.1f",a[d][d1]); putchar('\n'); } }



LinkBack URL
About LinkBacks


