gpt4 book ai didi

c - 在 C 中使用 randomize() 而不使用 time.h

转载 作者:行者123 更新时间:2023-11-30 18:32:12 25 4
gpt4 key购买 nike

我能够运行使用 randomize 函数的代码,而不包含 time.h 库。它是否自动包含在我可能已经包含在我的代码中的其他一些库中?以下是我包含的库的列表:

#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <dos.h>
#include <string.h>
#include <io.h>

最佳答案

这对于您的库的版本和实现非常具体。该标准不会强制任何 header 包含 time.h 1,因此您不能依赖它。

就您而言,可能是 dos.hio.hconio.h 之一包含 time.h (或任何其他具有其值(value)的 header )。

<小时/>

1 至少不是那里的那些,也不可能在你看似古老的图书馆里。 C11 说 threads.h 应该包含 time.h

关于c - 在 C 中使用 randomize() 而不使用 time.h,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15769672/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com