fork download
  1. #include <time.h>
  2. #include <stdio.h>
  3.  
  4.  
  5. void put_date(void)
  6. {
  7. time_t current;
  8. struct tm *local;
  9. char wday_name[][3]
  10. ={"日", "月", "火", "水", "木", "金", "土"};
  11.  
  12. time(&current);
  13. local = localtime(&current);
  14. printf("%4d年%02d月%02d日(%s)",
  15. local->tm_year + 1900,
  16. local->tm_mon + 1,
  17. local->tm_mday,
  18. wday_name[local->tm_wday] );
  19. int main(void)
  20. {
  21. printf("今日は");
  22. put_date();
  23. printf("です。\n");
  24.  
  25. return (0);
  26. }
  27.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘put_date’:
prog.c:19: warning: ‘main’ is normally a non-static function
prog.c:26: error: expected declaration or statement at end of input
stdout
Standard output is empty