在C ++中解析命令行参数? [英] Parsing Command Line Arguments in C++?

查看:52
本文介绍了在C ++中解析命令行参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果指定程序以这种方式运行,那么在C ++中解析命令行参数的最佳方法是什么:

What is the best way of parsing command-line arguments in C++ if the program is specified to be run like this:

prog [-abc] [input [output]]

是否可以通过某种方式将其内置到标准库中?还是需要编写自己的代码?

Is there some way of doing this built into the standard library, or do I need to write my own code?

相关:

推荐答案

Boost.Program_options 应该可以解决问题

这篇关于在C ++中解析命令行参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆