char data _DispBuf[]={1,2,3,4,5,6}; void main(void) { long tmp,a=0; while(1) { _DispBuf[1]++; tmp = (long)(_DispBuf[0]*100000); tmp = tmp + (long)(_DispBuf[1]*10000); //————!!! tmp = tmp + (long)(_DispBuf[2]*1000); tmp = tmp + (long)(_DispBuf[3]*100); tmp = tmp + (long)(_DispBuf[4]*10); tmp = tmp + (long)(_DispBuf[5]); a = tmp; } } 当_DispBuf[1]=4时,(long)(_DispBuf[1]*10000)确不等于40000。为何?但0至3是正确的。
|