optimization

This commit is contained in:
Dmitry Borisenko
2020-08-31 01:45:43 +03:00
parent 0005760774
commit 3816711f04
2 changed files with 20 additions and 2 deletions

View File

@@ -86,6 +86,23 @@ void setup() {
just_load = false;
initialized = true;
String buf = "Geeks-for-Geeks";
int buf_len = buf.length() + 1;
char char_array[buf_len];
buf.toCharArray(char_array, buf_len);
char* token = strtok(char_array, "-");
while (token != NULL) {
printf("%s\n", token);
token = strtok(NULL, "-");
}
//char str[] = "Geeks for Geeks";
//char* token;
//char* rest = str;
//while ((token = strtok_r(rest, " ", &rest))) {
// printf("%s\n", token);
//}
}
void loop() {