@ テスト駆動開発による組み込みプログラミング by James Grenning
strtok()は実際に文字列を変更する
test.c
#include <stdio.h>
#include <string.h>
int main(void) {
char inpBuf[]= "abc,def";
char *token1;
printf("%s\n", inpBuf);
token1 = strtok(inpBuf, "., ");
printf("%s\n", inpBuf);
return 0;
}
結果
Success time: 0 memory: 2112 signal:0
abc,def
abc