指针加常量,报告出错,求大神指导
#include<stdio.h>#define SIZE 4
int main(void){
short dates[SIZE];
double index;
short *pti;
double bills[SIZE];
double *ptf;
pti=dates;
ptf=bills;
printf("%23s %10s","short","double");
for(index=0;index<SIZE;index++)
printf("pointer + %d: %10P %10p\n",index,pti+index, ptf+index);
return 0;
}
指针:double *ptf;short *pti;
编译出错error C2111: pointer addition requires integral operand