关于数组下标为负的问题,很迷惑
char s[32]; for(i=28;i>=0;i--) { s[i-28]=encode>>i&0x01; } for(n=0;n<29;n++) { if(s[n]==0x01) { GPIO_SetBits(GPIOB, GPIO_Pin_0); Delay(5); GPIO_ResetBits(GPIOB, GPIO_Pin_0); Delay(5); } else if(s[n]==0x00) { GPIO_ResetBits(GPIOB, GPIO_Pin_0); Delay(10); } }#include <iostream>using namespace std;int main(){ int a[5] ={1,2,3,4,5}; int *p = &a[3]; cout<<a[1]<<endl; cout<<p[-1]<<endl; return 0;}