Dynamic Arrays? Does this really work?
Posted: Sat Dec 02, 2017 10:25 pm
I'm an experienced C++ programmer and I have never seen code like this that would compile.
From lines 77 to 82 of the WifiTelnetToSerial example project:
How does one define an array of uint8_t based on a dynamic value not known at compile time? This seems like something I'd see in a dynamic interpreted language, I've never seen it in a C/C++ dialect.
How does this compile? Is this a bug?
From lines 77 to 82 of the WifiTelnetToSerial example project:
Code: Select all
//check UART for data
if(Serial.available()){
size_t len = Serial.available();
uint8_t sbuf[len];
Serial.readBytes(sbuf, len);
How does one define an array of uint8_t based on a dynamic value not known at compile time? This seems like something I'd see in a dynamic interpreted language, I've never seen it in a C/C++ dialect.
How does this compile? Is this a bug?