I'm trying to write a .bmp in C++ but unsigned char can't hold a value high enough for my needs and other data types add padding because of specific byte alignment that makes a mess of things. So is there an alternative data type that can hold a higher value that won't add padding (or a way to make unsigned char hold a higher value)?
views:
117answers:
2
+2
A:
It sounds as if you are misunderstanding how data is stored.
If you have a bmp image in memory it may be kept in an internal structure (struct/class) however you can serialize that to an array of unsigned chars (bytes) which you write to a file. A file opened in binary mode doesn't add anything more than what you write.
Anders K.
2010-08-09 00:24:40