C++ - include unistd.h: why not cunistd?

后端 未结 4 797
离开以前
离开以前 2021-02-02 05:00

It\'s said that when including C header files in C++, the \".h\" suffix should be removed and then add \"c\" at the beginning. For example, #include

4条回答
  •  没有蜡笔的小新
    2021-02-02 05:26

    Your algorithm is correct for most (all?) standard C headers, but unistd.h is not part of standard C so standard C++ in turn doesn't include it with the other c... headers.

提交回复
热议问题