#include <stdio.h> void trans(int a[4]){ char result; int i; for(i=0;i<4;i++){ result = a[i] + '0'; if(i<3) printf("%c ",result); else printf("%c",result); } } int main(){ int s[4]; for(i=0;i<4;i++) scanf("%d",&s[i]); trans(s[4]); return 0; } /* Main.c: In function 'main': Main.c:15:7: error: 'i' undeclared (first use in this function) for(i=0;i<4;i++) ^ Main.c:15:7: note: each undeclared identifier is reported only once for each function it appears in Main.c:17:9: warning: passing argument 1 of 'trans' makes pointer from integer without a cast trans(s[4]); ^ Main.c:2:6: note: expected 'int *' but argument is of type 'int' void trans(int a[4]){ ^ */ |
Double click to view unformatted code.