locka99 / cpp-to-rust-book

Other
74 stars 24 forks source link

Types table is incorrect #2

Open jplatte opened 7 years ago

jplatte commented 7 years ago

Equating char to i8 is wrong in two ways: Its signedness as well as its size are unspecified in the C and C++ standards.

According to an answer on Stack Overflow there are even real platforms out there with 16 or 32 bit chars. But AFAIK, for all the platforms Rust supports, you can at assume chars to be 8 bits in size, and thus signed char == i8, unsigned char == u8.

cppreference.com documentation about the char type (and other primitive types): C, C++

jplatte commented 7 years ago

A few more things to note: