fork download
  1. bool search(int value, int values[], int n)
  2. {
  3. // TODO: implement a searching algorithm
  4. int val;
  5. for (int i = 0; i != n; i++)
  6. {
  7. if (values[i] != value)
  8. {
  9. val = 0;
  10. }
  11. else
  12. {
  13. val = 1;
  14. }
  15. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:1:1: error: unknown type name 'bool'
 bool search(int value, int values[], int n)
 ^
prog.c: In function 'search':
prog.c:15:5: error: expected declaration or statement at end of input
     }
     ^
prog.c:4:9: warning: variable 'val' set but not used [-Wunused-but-set-variable]
     int val;
         ^
prog.c:15:5: warning: control reaches end of non-void function [-Wreturn-type]
     }
     ^
stdout
Standard output is empty