Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在做一个C++项目,现在将一些功能移植到C. 该项目在我使用cpp文件时运行良好,但是,当我C在项目中包含文件时,编译器无法找到某些标头<limits>,例如<algorithm>等。
C++
C
cpp
<limits>
<algorithm>
有人可以帮我解决这个问题吗?
的 C 版本<limits>分别称为<limits.h>和<float.h>。它们的代码与 C++ 中的函数不兼容,<limits>但用途相同。
<limits.h>
<float.h>
<algorithm>是纯 C++ 库头文件,不能在 C 程序中使用。如果您的代码依赖于 中的功能<algorithm>,则必须从头开始重写它们。