Is something like this possible in C++ (on Arduino)?
#include "stdio.h"
String str = "foo";
int i[strLength()]; // <- define length of array in function
int strLength() {
return str.length();
}
int main(void) {
...
}
Thank you in advance!
No. You would need
ito be a pointer and allocate the array in yourmain: