fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. #define ile 5
  5.  
  6. struct all
  7. {
  8. double tab[ile];
  9. };
  10.  
  11. int main (){
  12.  
  13. A.tab[0] = -5
  14. A.tab[1] = 7
  15. A.tab[2] = 0
  16. A.tab[3] = 4
  17. A.tab[4] = -1
  18.  
  19. struct complex M;
  20. M = max(tab,ile);
  21.  
  22. wypisz_tablice(tab,ile);
  23. printf(" %5.3f ",>);
  24.  
  25. return 0
  26. }
  27.  
  28. void max(double tab, long nelem){
  29. for(i=0, i<nelem, i++){
  30. long M;
  31. M = tab[0];
  32. if (M>A.tab[i]){
  33. M = A.tab[i];
  34. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function 'main':
prog.c:13:1: error: 'A' undeclared (first use in this function)
 A.tab[0] = -5
 ^
prog.c:13:1: note: each undeclared identifier is reported only once for each function it appears in
prog.c:14:1: error: expected ';' before 'A'
 A.tab[1] = 7
 ^
prog.c:20:1: error: 'M' undeclared (first use in this function)
 M = max(tab,ile);
 ^
prog.c:20:5: warning: implicit declaration of function 'max' [-Wimplicit-function-declaration]
 M = max(tab,ile);
     ^
prog.c:20:9: error: 'tab' undeclared (first use in this function)
 M = max(tab,ile);
         ^
prog.c:22:1: warning: implicit declaration of function 'wypisz_tablice' [-Wimplicit-function-declaration]
 wypisz_tablice(tab,ile);
 ^
prog.c:23:18: error: expected expression before '>' token
 printf(" %5.3f ",>);
                  ^
prog.c:26:1: error: expected ';' before '}' token
 }
 ^
prog.c: At top level:
prog.c:28:6: warning: conflicting types for 'max'
 void max(double tab, long nelem){
      ^
prog.c:20:5: note: previous implicit declaration of 'max' was here
 M = max(tab,ile);
     ^
prog.c: In function 'max':
prog.c:29:5: error: 'i' undeclared (first use in this function)
 for(i=0, i<nelem, i++){
     ^
prog.c:29:8: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 for(i=0, i<nelem, i++){
        ^
prog.c:29:17: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 for(i=0, i<nelem, i++){
                 ^
prog.c:29:22: error: expected ';' before ')' token
 for(i=0, i<nelem, i++){
                      ^
prog.c:29:22: error: expected expression before ')' token
prog.c:31:8: error: subscripted value is neither array nor pointer nor vector
 M = tab[0];
        ^
prog.c:32:7: error: 'A' undeclared (first use in this function)
 if (M>A.tab[i]){
       ^
prog.c:34:1: error: expected declaration or statement at end of input
 }
 ^
prog.c:34:1: error: expected declaration or statement at end of input
stdout
Standard output is empty