char string library. There is a character string splitting function.

Files at this revision

API Documentation at this revision

Comitter:
tichise
Date:
Sun Apr 29 05:01:14 2018 +0000
Parent:
1:fc299d8c1c7e
Child:
3:a69058b7a85e
Commit message:
refactoring

Changed in this revision

CharUtil.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/CharUtil.cpp	Sun Dec 03 06:19:23 2017 +0000
+++ b/CharUtil.cpp	Sun Apr 29 05:01:14 2018 +0000
@@ -7,14 +7,14 @@
 }
 
 int CharUtil::split(char *base, const char *delim, char *outlist[]){
-    char *token;
+    char *tokenPointer;
     int cnt = 0;
 
-    token = strtok(base, delim);
+    tokenPointer = strtok(base, delim);
 
-    while(token != NULL && cnt < MAXITEM) {
-        outlist[cnt++] = token;
-        token = strtok(NULL, delim);
+    while(tokenPointer != NULL && cnt < MAXITEM) {
+        outlist[cnt++] = tokenPointer;
+        tokenPointer = strtok(NULL, delim);
     }
 
     return cnt;