Determine if Linux or Windows in C++

后端 未结 6 1875
忘了有多久
忘了有多久 2021-02-04 00:40

I am writing a cross-platform compatible function in C++ that creates directories based on input filenames. I need to know if the machine is Linux or windows and use the appropr

6条回答
  •  盖世英雄少女心
    2021-02-04 01:02

    Generally speaking, you'd have do do this with conditional compilation.

    That said, if you're using boost::filesystem you should be using the portable generic path format so that you can forget about things like this.

提交回复
热议问题