Safer but easy-to-use and flexible C++ alternative to sscanf()

后端 未结 3 1330
轮回少年
轮回少年 2020-12-01 04:11

When I need to scan in values from a bunch of strings, I often find myself falling back to C\'s sscanf() strictly because of its simplicity and ease of use. For

3条回答
  •  广开言路
    2020-12-01 04:34

    I think that with regex it could be done easy. So boost::regex or std::regex in a new standard. After that just convert your tokens to float by using lexical_cast or streams directly.

提交回复
热议问题