char string library. There is a character string splitting function.
CharUtil.cpp
- Committer:
- tichise
- Date:
- 2018-04-29
- Revision:
- 3:a69058b7a85e
- Parent:
- 2:dbd6f2a04946
File content as of revision 3:a69058b7a85e:
#include "CharUtil.h" #include "mbed.h" #define MAXITEM 20 // 数字が大きすぎるとメモリーオーバーエラーがでる CharUtil::CharUtil() { } int CharUtil::split(char *base, const char *delim, char *outlist[]){ char *tokenPointer; int cnt = 0; tokenPointer = strtok(base, delim); while(tokenPointer != NULL && cnt < MAXITEM) { outlist[cnt++] = tokenPointer; tokenPointer = strtok(NULL, delim); } return cnt; }