man1234567 發(fā)表于 2022-12-13 17:20
溢出錯(cuò)誤。
int能存儲(chǔ)的數(shù)據(jù)的范圍為:-32768~32767,32768自然出錯(cuò);
unsigned int能存儲(chǔ)的數(shù)據(jù)范圍為: ...
Hephaestus 發(fā)表于 2022-12-13 16:25
好奇怪,我用MinGW_x64 8.1運(yùn)行了下你的分拆那部分代碼,沒(méi)有問(wèn)題!
沒(méi)有仿真器就用串口把ge,shi,bai, ...
wulin 發(fā)表于 2022-12-13 16:47
void display(i)//參數(shù)沒(méi)有聲明數(shù)據(jù)類型輸錯(cuò)。改為 void display(uint i)
man1234567 發(fā)表于 2022-12-13 17:20
溢出錯(cuò)誤。
int能存儲(chǔ)的數(shù)據(jù)的范圍為:-32768~32767,32768自然出錯(cuò);
unsigned int能存儲(chǔ)的數(shù)據(jù)范圍為: ...
ldc2000 發(fā)表于 2022-12-13 18:19
感謝大神!按您改的可以正常顯示了。但我已經(jīng)在上面定義了全局變量 uint i,為什么這里還需要再次聲明一 ...
wulin 發(fā)表于 2022-12-13 19:07
此“i”非彼“i”,void display(i)形參不聲明數(shù)據(jù)類型Keil編譯器默認(rèn)int型,數(shù)據(jù)范圍-32768~32767。
歡迎光臨 (http://www.torrancerestoration.com/bbs/) | Powered by Discuz! X3.1 |