integer extraction from string

前端 未结 5 964
天命终不由人
天命终不由人 2021-01-26 18:37

I have an input argument string const char* s I know that it starts the sequence of chars which are integers representation ,this sequence could be of any length ,

5条回答
  •  借酒劲吻你
    2021-01-26 18:50

    atoi() should do what you want to, although a more robust implementation would use strtol().

提交回复
热议问题