gpt4 book ai didi

c++ - stdio.h 在 C++ 中不是标准的?

转载 作者:IT老高 更新时间:2023-10-28 22:23:48 27 4
gpt4 key购买 nike

我知道大多数编译器都允许:

#include <stdio.h>

#include <cstdio>

但有人认为 <stdio.h>实际上不是 C++ 标准。这是真的吗?

最佳答案

stdio.h是标准的,但已弃用。永远喜欢 cstdio在 C++ 中。

[n3290: C.3.1/1]: For compatibility with the Standard C library, the C++ standard library provides the 18 C headers (D.5), but their use is deprecated in C++.

[n3290: D.5/3]: [ Example: The header <cstdlib> assuredly provides its declarations and definitions within the namespace std. It may also provide these names within the global namespace. The header <stdlib.h> assuredly provides the same declarations and definitions within the global namespace, much as in the C Standard. It may also provide these names within the namespace std. —end example ]

关于c++ - stdio.h 在 C++ 中不是标准的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7596406/

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