C: correct usage of strtok_r

前端 未结 4 1470
温柔的废话
温柔的废话 2020-11-30 07:11

How can I use strtok_r instead of strtok to do this?

char *pchE = strtok(NULL, \" \");

Now I\'m trying to use strtok_r properl

4条回答
  •  渐次进展
    2020-11-30 07:56

    char str[]="string for sample";
    char *reserve;
    char *pchE = strtok_r(str, " ", &reserve);//when next call str -> NULL
    

提交回复
热议问题