根据我检查的文档,time_t time(time_t *seconds)在<time.h>头文件下声明。然而,当我运行这段代码时:
#include<stdio.h>
#include<stdlib.h>
int main()
{
srand(time(NULL));
printf("%d",rand());
return 0;
}
Run Code Online (Sandbox Code Playgroud)
不包括<time.h>,它工作正常,或者至少工作。怎么会这样?
c header-files forward-declaration function-declaration c-header