문제

I'm working on a C++ project and now porting some functions to C. The project works well when I'm using the cpp files, however, when I include the C files in the project, the compiler is unable to find certain headers like <limits>, <algorithm> etc.

Could someone help me with this?

도움이 되었습니까?

해결책

The C versions of <limits> are called <limits.h> and <float.h> respectively. They are not code compatible with the funcions in C++ <limits> but serve the same purposes.

<algorithm> is a pure C++ library header and cannot be used in C programs. If your code relies on features from <algorithm>, they will have to be rewritten from scratch.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top