看板 C_and_CPP 關於我們 聯絡資訊
原文恕刪。 乾脆直接講重點:bit-field的缺點。 http://stackoverflow.com/questions/10740853 /disadvantages-of-using-bitfields-in-memory - 可攜性大幅降低,尤其是當你轉換到Endianness不同的平台上(這個問題超大)。 http://mjfrazer.org/mjfrazer/bitfields/ - 效能沒有native類型來的好。 compiler還要花時間處理Bit slicing跟資料對齊問題 - 不能用address連到該元件 - 不能用sizeof - 做integer promotions會增加不必要的誤解。 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 90.41.133.100 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1469978253.A.794.html
Caesar08: 有,這我後來有找到了 XD 07/31 23:22