fork(1) download
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <stdio.h>
  3. #include <string.h>
  4.  
  5. int main()
  6. {
  7. char *s = "0xaf10 42 0x27C 9952";
  8. int num1;
  9. int num2;
  10. int num3;
  11. int num4;
  12. char *end;
  13.  
  14.  
  15. num1=strtol(s, &end, 16);
  16. num2=strtol(end, &end, 10);
  17. num3=strtol(end, &end, 16);
  18. num4=strtol(end, NULL, 10);
  19. printf("%d\n", num);
  20.  
  21.  
  22. return 0;
  23. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function 'main':
prog.c:15:7: warning: implicit declaration of function 'strtol' [-Wimplicit-function-declaration]
  num1=strtol(s, &end, 16);
       ^
prog.c:19:17: error: 'num' undeclared (first use in this function)
  printf("%d\n", num);
                 ^
prog.c:19:17: note: each undeclared identifier is reported only once for each function it appears in
prog.c:11:6: warning: variable 'num4' set but not used [-Wunused-but-set-variable]
  int num4;
      ^
prog.c:10:6: warning: variable 'num3' set but not used [-Wunused-but-set-variable]
  int num3;
      ^
prog.c:9:6: warning: variable 'num2' set but not used [-Wunused-but-set-variable]
  int num2;
      ^
prog.c:8:6: warning: variable 'num1' set but not used [-Wunused-but-set-variable]
  int num1;
      ^
stdout
Standard output is empty