简体   繁体   English

c++版Python的os模块

[英]c++ version of Python's os module

what is the c++ module equivalent of Python's "import os"?什么是与 Python 的“import os”等效的 c++ 模块?

Any time I try to google "c++ version of python os", it shows me how to get the operating system version in either python or c++.每当我尝试用谷歌搜索“python os 的 c++ 版本”时,它都会向我展示如何在 python 或 c++ 中获取操作系统版本。

There isn't a direct equivalent in C++, but you can achieve same things by other means. C++ 中没有直接的等效项,但您可以通过其他方式实现相同的目标。 For example, <filesystem> header has functionality to work with paths, some OS-specific headers like <Windows.h> have more functionality at the cost of being non-portable and so on.例如, <filesystem> header 具有使用路径的功能,一些特定于操作系统的标头(例如<Windows.h> )具有更多功能,但代价是不可移植等等。 Depends on what you want to do.取决于你想做什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM