What's an effective way to parse command line parameters in C++?

前端 未结 6 2047
滥情空心
滥情空心 2021-02-09 05:46

Is there a really effective way of dealing with command line parameters in C++?

What I\'m doing below feels completely amateurish, and I can\'t imagine this is how comma

6条回答
  •  梦毁少年i
    2021-02-09 06:25

    I would recommend always using boost lexical_cast<> in place of junk like atoi, atof, etc.

    http://www.boost.org/doc/libs/release/libs/conversion/lexical_cast.htm

    Other than that your code okay for simple stuff.

提交回复
热议问题