我正在用 C 语言在 uVision 4 上进行 ARM 分配编码。我似乎无法弄清楚,但每次我不断得到字符串“536876144”。
int main(void) {
int binary[8] = {0,0,0,0,0,0,0,0};//I want this array as integers (for binary terms), therefore i can toggle each number as 1 or 0, corresponding to the input.
char stringbinary[9]; //string for recording the value of the converted integer array
sprintf(stringbinary, "%d", binary);//conversion of the array to string
printf("%s\r\n",stringbinary);//printing the value
.............
.............
if(input=1){
binary[0]=1 - binary[0]; // I have the each value of the array to toggle with activation
}
}
这可能只是因为我在编码数小时后感到疲倦。我很确定这是简单而基本的东西,但我似乎找不到它。