This commit is contained in:
Dmitry Borisenko
2020-08-31 02:13:02 +03:00
parent e66b49ddc3
commit a9fc6f73f5
2 changed files with 13 additions and 6 deletions

View File

@@ -1,4 +1,5 @@
#pragma once
void setupTest();
void loopTest();
void loopTest();
//char stringToCharArray(String in);

View File

@@ -1,15 +1,14 @@
#include "Global.h"
#include "test.h"
#include "Global.h"
void setupTest() {
//пример выделения подстрок
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, "-");
@@ -24,5 +23,12 @@ void setupTest() {
}
void loopTest() {
}
}
//char stringToCharArray(int& i, String in) {
// int in_len = in.length() + 1;
// i = in_len;
// char char_array[in_len];
// in.toCharArray(char_array, in_len);
// return char_array[in_len];
//}