這個代碼和你想的結果相反是爲什麼

這個代碼和你想的結果相反是爲什麼 #include using namespace std; void d(void){ unsigned int a=8;int b = -20; (a = b>8)?put(">8"):puts("<=8"); } 答案:>8 原因:當表達式中存在有符號類型和無符號類型時所有的操作數都會自動轉換成無符號數。
相關文章
相關標籤/搜索