此代码
#include "alloca.h"
String str = "abc";
unsigned int *i;
void setup() {
Serial.begin(9600);
i = alloca(StringLength() * sizeof(i));
unsigned int j[StringLength() * sizeof(i)];
}
int StringLength() {
return str.length();
}
void loop() {
}
给我以下错误信息:
sketch_dec11f.cpp:在函数'void setup()'中:sketch_dec11f.cpp:14:7:错误:从'void *'到'unsigned int *'的无效转换
我究竟做错了什么?
(也尝试过使用malloc(),也没有用!)