-
data assignment
I am using an old version of MS C++ compiler 1.5 and want to be able to assign a binary value directly to a variable. I know how to assign hex, decimal, long and octal values but not binary. For example:
unsigned char MyVal = 5;
needs to be
unsigned char MyVal = 00000101;
Thanks for any help.
-
any reason for this? c++ doesn't allow that but you can make up some templates that does it at compile time or use atoi at runtime but thats just a waste of time both compile design and runtime if you ask me. if its just for aestetic reasons forget about it and write in hex and get on with it, or choose another language.
-
I am porting over a driver for a graphics LCD display that was originally written in assembler and already have the 256 char bitmapped character set that i want to use. This saves me having to go through and convert every character manually (8x8 font, lots of conversion). If there is no way to do this i will have to write something to read the file and automate the conversion. Thanks.
-