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

后端 未结 4 714
离开以前
离开以前 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.

    0 讨论(0)
  • 2021-02-02 05:30

    unistd.h is not part of standard C. Standard C++ lib doesn't include it with the other c headers.

    0 讨论(0)
  • 2021-02-02 05:47

    Because unistd.h never was part of the C language. It is part of the Operating System.

    0 讨论(0)
  • 2021-02-02 05:47

    <unistd.h> , stands for unix standard header ,the name says it all.

    0 讨论(0)
提交回复
热议问题