fork download
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #define totalnum 8
  4. void display(int **);
  5. int main()
  6. {
  7. int marks[totalnum]={55,65,75,85,90,78,95,60};
  8. printf("The marks of student A are:");
  9. display(marks);
  10. return 0;
  11. }
  12. void display(int *x)
  13. {
  14. int i;
  15. for(i=0;i<totalnum;i++)
  16. printf("\n%d",x);
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:9:5: warning: passing argument 1 of ‘display’ from incompatible pointer type [enabled by default]
     display(marks);
     ^
prog.c:4:6: note: expected ‘int **’ but argument is of type ‘int *’
 void display(int **);
      ^
prog.c: At top level:
prog.c:12:6: error: conflicting types for ‘display’
 void display(int *x)
      ^
prog.c:4:6: note: previous declaration of ‘display’ was here
 void display(int **);
      ^
prog.c: In function ‘display’:
prog.c:16:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘int *’ [-Wformat=]
     printf("\n%d",x);
     ^
stdout
Standard output is empty