We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
flowing is error,Please help me!! #include <stdio.h> #define NUMBER 2 int max(int a[]) { int z; if(a[0]>a[1]) z=a[0]; else z=a[1]; return(z); } int process(void (* fun)(void *p),void *arg) { int z; z=(int *)(* fun)((int *)arg); return(z); } main() { int a[NUMBER]; int i; int d; for(i=0;i++;i<NUMBER) a[i]=i; d=process(max,a); while(1); }
#include <stdio.h> #define NUMBER 2 int max(int a[]) { int z; if(a[0]>a[1]) z=a[0]; else z=a[1]; return(z); } int process(void (* fun)(void *p),void *arg) { int z; z=(int *)(* fun)((int *)arg);
return(z); } main() { int a[NUMBER]; int i; int d; for(i=0;i++;i<NUMBER) a[i]=i;
d=process(max,a);
while(1); }
Sorry. I said: It appears you have the loop termination expression and the loop iteration expression reversed. That should be test, not termination.