fork download
  1. #include <stdio.h>
  2. #include <stdbool.h>
  3. #include <errno.h>
  4.  
  5. static bool parse(const char *str) {
  6. if (!str) {
  7. errno = EINVAL;
  8. return false;
  9. }
  10. return true;
  11. }
  12.  
  13. int main(void) {
  14. if (!parse(NULL)) {
  15. switch (errno) {
  16. case EINVAL: printf("不正な引数\n"); break;
  17. }
  18. }
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
不正な引数