我已经为我的Arduino制作了一个程序,它将按升序或降序排序五十个随机数的数组,我想我已经把它弄好了,但是当我运行它时,我收到一条错误消息“期望不合格的id之前”为'“ .
int array [50];
int i = 0;
void setup() {
Serial.begin(9600); // Load Serial Port
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println ("Position " + array[i]);
delay (2000);
}
for (i <= 50) {
int n = random (251); // Random number from 0 to 250
array[i] = n;
i++;
}
// Bubble sort function
void sort (int a[], int size) {
for(int i=0; i
for(int o=0; o
if(a[o] > a[o+1]) {
int t = a[o];
a[o] = a[o+1];
a[o+1] = t;
}
}
}
}
我已注释显示错误的位置 . 我需要通过这个来测试我的代码,我不知道如何解决它!