View Single Post
Old 07-19-2016, 08:17 AM   #11
Soundwave-
Carry your failures proud
FFR Veteran
 
Soundwave-'s Avatar
 
Join Date: Sep 2015
Age: 23
Posts: 644
Default Re: programming question

Quote:
Originally Posted by inDheart View Post
tl;dr no, short is not char and your post is dangerously confused about data types. i'll even venture a guess that char and short are different sizes on your machine.
The only error seems to be the part where I mistakenly assumed C and Java chars were analogous, which was actually strange to me as a mistake to make considering I'm well acquainted with the concept of a wide character, which exists precisely because C and Java chars, are, in fact not analogous.

Say a char is an integer is entirely correct from a C perspective and mostly correct from a C++ perspective, though it needn't necessarily be the case (which I think should be clear by my explanation of how fucked up C integers are) and also almost certainly not the case that a short is equally as long.

For correctness and tl;dr sake, a char is always a "byte", where a byte is defined as the smallest addressable data size. This will almost certainly be 8 bits except on embedded devices that have memory addressed in 16 bit chunks for speed and simplicity of architecture, and you know, whatever other weird exceptions out there.

And, for record's sake:


An incredibly unsurprising result, given the correction.
__________________
Quote:
Originally Posted by [11:38 PM] Hakulyte
only person who can legit tilt me is like YoshL
Quote:
Originally Posted by スンファンさん
右に3回回らない限り間違います。
Soundwave- is offline   Reply With Quote