fork download
  1. static char *
  2. isvalidname(char *rname)
  3. {
  4. #ifdef FOREIGN_REG
  5. return NULL;
  6. #else
  7. const char *rejectstr[] =
  8. {"肥", "胖", "豬頭", "小白", "小明", "路人", "老王", "老李", "寶貝",
  9. "先生", "帥哥", "老頭", "小姊", "小姐", "美女", "小妹", "大頭",
  10. "公主", "同學", "寶寶", "公子", "大頭", "小小", "小弟", "小妹",
  11. "妹妹", "嘿", "嗯", "爺爺", "大哥", "無",
  12. NULL};
  13. if( removespace(rname) && rname[0] < 0 &&
  14. strlen(rname) >= 4 &&
  15. !HaveRejectStr(rname, rejectstr) &&
  16. strncmp(rname, "小", 2) != 0 && //起頭是「小」
  17. strncmp(rname, "我是", 4) != 0 && //起頭是「我是」
  18. !(strlen(rname) == 4 && strncmp(&rname[2], "兒", 2) == 0) &&
  19. !(strlen(rname) >= 4 && strncmp(&rname[0], &rname[2], 2) == 0))
  20. return NULL;
  21. return "您的輸入似乎不正確";
  22. #endif
  23.  
  24. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘isvalidname’:
prog.c:12:3: error: ‘NULL’ undeclared (first use in this function)
   NULL};
   ^
prog.c:12:3: note: each undeclared identifier is reported only once for each function it appears in
prog.c:13:5: warning: implicit declaration of function ‘removespace’ [-Wimplicit-function-declaration]
     if( removespace(rname) && rname[0] < 0 &&
     ^
prog.c:14:2: warning: implicit declaration of function ‘strlen’ [-Wimplicit-function-declaration]
  strlen(rname) >= 4 &&
  ^
prog.c:14:2: warning: incompatible implicit declaration of built-in function ‘strlen’ [enabled by default]
prog.c:15:2: warning: implicit declaration of function ‘HaveRejectStr’ [-Wimplicit-function-declaration]
  !HaveRejectStr(rname, rejectstr) &&
  ^
prog.c:16:2: warning: implicit declaration of function ‘strncmp’ [-Wimplicit-function-declaration]
  strncmp(rname, "小", 2) != 0   && //起頭是「小」
  ^
prog.c:20:2: warning: return from incompatible pointer type [enabled by default]
  return NULL;
  ^
prog.c: At top level:
prog.c:2:1: warning: ‘isvalidname’ defined but not used [-Wunused-function]
 isvalidname(char *rname)
 ^
stdout
Standard output is empty