This article gives the answer in Java. http://chrononsystems.com/blog/hidden-evils-of-javas-byte-array-byte
Basically, Java takes a byte, instead of a bit, to store a bool. So it ends up using an array of bytes.
Same for C++.
And think it over, malloc allocates memory in bytes, isn't it?
void* malloc (size_t size);
Allocate memory block
No comments:
Post a Comment