What should I use instead of sscanf?

后端 未结 5 2124
南笙
南笙 2020-12-14 16:17

I have a problem that sscanf solves (extracting things from a string). I don\'t like sscanf though since it\'s not type-safe and is old and horrible. I want to be clever and

5条回答
  •  难免孤独
    2020-12-14 16:50

    If you really want not to use streams (It's good because of readability), you can use StringPrintf.

    You can find its implementation in Folly:

    https://github.com/facebook/folly/blob/master/folly/String.h#L165

提交回复
热议问题