gpt4 book ai didi

c - 为什么我可以在不包含所需 header 的情况下使用 isspace()?

转载 作者:太空宇宙 更新时间:2023-11-04 00:47:39 24 4
gpt4 key购买 nike

<分区>

为什么这段代码有效:

    #include <stdio.h>

int main()
{
int x = isspace(getchar());
printf("%d", x);
return 0;
}

每当我输入空格时 isspace()返回 8,当我不返回时,它返回 0。

这不应该在编译时产生错误吗?我没有添加 #include <ctype.h>在顶部。那么为什么允许这样做呢?

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