看板 Programming 關於我們 聯絡資訊
突然忘記 i最後 為什麼等於2 要怎麼解釋呢? 3q #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { unsigned char i,j; i=255, j=1; i=j-i; printf("i= %d", i); system("PAUSE"); return 0; } -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.163.150.163 ※ 文章網址: https://www.ptt.cc/bbs/Programming/M.1542092940.A.629.html
chrisos: 1byte = 0~255 42.73.158.239 11/13 15:51
chrisos: 1-1 = 0(256) 256-254=2 42.73.158.239 11/13 15:53
chuegou: 0x01-0x02=0xff 223.136.52.245 11/13 18:56