static const unsigned char Test[8] =
{
00000001b,
00000010b,
00000100b,
00001000b,
00010000b,
00100000b,
01000000b,
10000000b,
};
but it doesn''t like that, i tried it with ''0x'' on the front, but it says its truncating, so i think its wrong.
syntax for defining a binary number?
sorry for the braindead question, but its very hard to google for this because i don''t know what ot search for. how do you define a binary number? like this:
You can''t. Write in hexadecimal form instead - it''s very easy to convert between binary and hexadecimal representations, after all.
If the binary numbers you''re trying to represent are powers of 2, you can also simplify things and make them more clear by using the bitshift operator.
Don''t listen to me. I''ve had too much coffee.
static const unsigned char Test[8] = { 1, 1 << 1, 1 << 2, 1 << 3, 1 << 4, 1 << 5, 1 << 6, 1 << 7,};
Don''t listen to me. I''ve had too much coffee.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement