Портативный код - бит на символ

Я знаю, что стандарты C / C ++ гарантируют толькоminimum 8 бит на символ, и это теоретически 9/16/42 / что-нибудь еще возможно, и поэтому все сайты о написании переносимого кода предостерегают от принятия 8bpc. У меня вопрос как "непереносимый" это правда?

Позволь мне объяснить. На мой взгляд, существует 3 категории систем:

Computers - I mean desktops, laptops, servers, etc. running Mac/Linux/Windows/Unix/*nix/posix/whatever (I know that list isn't strictly correct, but you get the idea). I would be very surprised to hear of any such system where char is not exactly 8 bits. (please correct me if I am wrong) Devices with operating systems - This includes smartphones and such embedded systems. While I will not be very surprised to find such a system where char is more tham 8 bits, I have not heard of one to date (again, please inform me if I am just unaware) Bare metal devices - VCRs, microwave ovens, old cell phones, etc. In this field I haven't the slightest experience, so anything can happen here. However, do I really need my code to be cross platform between my Windows desktop and my microwave oven? Am I likely to ever have code common to both?

Итог: Существуют ли распространенные (более% 0,001) платформы (в категориях 1 и 2 выше), гдеchar являетсяnot 8 бит? И верно ли мое предположение выше?

Ответы на вопрос(4)

Ваш ответ на вопрос