byte B= 0x0F;// Hex. representaion --> How byte B=0001111 // Binary rep.?

G

Guest

In C/C++ we can use hexadecimal notation as byte B= 0x0F;

How can we use binary numbers representaion for the same assignmnet ie.byte
B=0001111 // Binary rep.?
 
V

Victor Bazarov

zoom said:
In C/C++ we can use hexadecimal notation as byte B= 0x0F;

How can we use binary numbers representaion for the same assignmnet ie.byte
B=0001111 // Binary rep.?

No such thing. You could use 'bitset', it can convert itself from
a string of 0s and 1s.

Victor
 
J

John Harrison

In C/C++ we can use hexadecimal notation as byte B= 0x0F;

How can we use binary numbers representaion for the same assignmnet
ie.byte
B=0001111 // Binary rep.?

C++ does not support a binary representation for numeric literals.

john
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top