<分区>
下面的代码我使用的是 Posix C:
while ((opt = getopt(argc, argv, "a:p:h")) != -1)
如何使用替代函数将此代码移植到 Windows C++?
谢谢
<分区>
下面的代码我使用的是 Posix C:
while ((opt = getopt(argc, argv, "a:p:h")) != -1)
如何使用替代函数将此代码移植到 Windows C++?
谢谢
最佳答案
Microsoft 在开源 IoTivity 项目中提供了一个很好的实现(以及一些其他帮助程序),您可以在这里重复使用(等待您可能有的任何许可要求):
在这里查看“getopt.h/.c”的“src”和“include”目录。
https://github.com/iotivity/iotivity/tree/master/resource/c_common/windows
关于c++ - Windows c++ 上 getopt 函数的替代方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30180521/