fork download
  1. #include <stdio.h>
  2. #include<string.h>
  3. int main(void) {
  4. // your code goes here
  5. char target = '-59';
  6. char str='-60';
  7. result = strcmp(target,str);
  8. if(result>0)
  9. printf("1")
  10. return 0;
  11. }
  12.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:5:16: warning: multi-character character constant [-Wmultichar]
  char target = '-59';
                ^~~~~
prog.c:5:16: warning: overflow in implicit constant conversion [-Woverflow]
prog.c:6:11: warning: multi-character character constant [-Wmultichar]
  char str='-60';
           ^~~~~
prog.c:6:11: warning: overflow in implicit constant conversion [-Woverflow]
prog.c:7:2: error: ‘result’ undeclared (first use in this function)
  result = strcmp(target,str);
  ^~~~~~
prog.c:7:2: note: each undeclared identifier is reported only once for each function it appears in
In file included from /usr/include/string.h:630:0,
                 from prog.c:2:
prog.c:7:18: warning: passing argument 1 of ‘__builtin_strlen’ makes pointer from integer without a cast [-Wint-conversion]
  result = strcmp(target,str);
                  ^
prog.c:7:18: note: expected ‘const char *’ but argument is of type ‘char’
prog.c:7:25: warning: passing argument 1 of ‘__builtin_strlen’ makes pointer from integer without a cast [-Wint-conversion]
  result = strcmp(target,str);
                         ^
prog.c:7:25: note: expected ‘const char *’ but argument is of type ‘char’
prog.c:7:18: warning: passing argument 1 of ‘__builtin_strcmp’ makes pointer from integer without a cast [-Wint-conversion]
  result = strcmp(target,str);
                  ^
prog.c:7:18: note: expected ‘const char *’ but argument is of type ‘char’
prog.c:7:25: warning: passing argument 2 of ‘__builtin_strcmp’ makes pointer from integer without a cast [-Wint-conversion]
  result = strcmp(target,str);
                         ^
prog.c:7:25: note: expected ‘const char *’ but argument is of type ‘char’
prog.c:7:18: warning: passing argument 1 of ‘__builtin_strlen’ makes pointer from integer without a cast [-Wint-conversion]
  result = strcmp(target,str);
                  ^
prog.c:7:18: note: expected ‘const char *’ but argument is of type ‘char’
prog.c:7:18: warning: passing argument 1 of ‘__builtin_strcmp’ makes pointer from integer without a cast [-Wint-conversion]
  result = strcmp(target,str);
                  ^
prog.c:7:18: note: expected ‘const char *’ but argument is of type ‘char’
prog.c:7:25: warning: passing argument 2 of ‘__builtin_strcmp’ makes pointer from integer without a cast [-Wint-conversion]
  result = strcmp(target,str);
                         ^
prog.c:7:25: note: expected ‘const char *’ but argument is of type ‘char’
prog.c:7:25: warning: passing argument 1 of ‘__builtin_strlen’ makes pointer from integer without a cast [-Wint-conversion]
  result = strcmp(target,str);
                         ^
prog.c:7:25: note: expected ‘const char *’ but argument is of type ‘char’
prog.c:7:18: warning: passing argument 1 of ‘__builtin_strcmp’ makes pointer from integer without a cast [-Wint-conversion]
  result = strcmp(target,str);
                  ^
prog.c:7:18: note: expected ‘const char *’ but argument is of type ‘char’
prog.c:7:25: warning: passing argument 2 of ‘__builtin_strcmp’ makes pointer from integer without a cast [-Wint-conversion]
  result = strcmp(target,str);
                         ^
prog.c:7:25: note: expected ‘const char *’ but argument is of type ‘char’
prog.c:7:18: warning: passing argument 1 of ‘__builtin_strcmp’ makes pointer from integer without a cast [-Wint-conversion]
  result = strcmp(target,str);
                  ^
prog.c:7:18: note: expected ‘const char *’ but argument is of type ‘char’
prog.c:7:25: warning: passing argument 2 of ‘__builtin_strcmp’ makes pointer from integer without a cast [-Wint-conversion]
  result = strcmp(target,str);
                         ^
prog.c:7:25: note: expected ‘const char *’ but argument is of type ‘char’
prog.c:10:2: error: expected ‘;’ before ‘return’
  return 0;
  ^~~~~~
stdout
Standard output is empty