getopt for Visual Studio CRT?

醉酒当歌 提交于 2019-12-11 04:21:51

问题


Is there an equivalent to getopt() in the visual studio CRT?

Or do I need to get it and compile it with my project?

Edit clarification
getopt is a utility function in the unix/linux C Run Time library for common command line parsing chores i.e. parsing arguments of the form -a -b -f someArg etc'


回答1:


You can use the getopt implementation from the GNU C library. It's licensed under the LGPL, which should be compatible with most software projects. See the file posix/getopt.c in the source distribution.




回答2:


Advice: boost::program_options instead.

http://www.boost.org/doc/libs/1_41_0/doc/html/program_options.html



来源:https://stackoverflow.com/questions/1935455/getopt-for-visual-studio-crt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!