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

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

Guest
Posts: n/a

 07-26-2004
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.?

Victor Bazarov
Guest
Posts: n/a

 07-26-2004
zoom wrote:
> 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

John Harrison
Guest
Posts: n/a

 07-26-2004
On Tue, 27 Jul 2004 05:41:30 +1000, <zoom> wrote:

> 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

 Thread Tools

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Edward A. Falk C Programming 1 04-04-2013 08:07 PM jeff@foundrymusic.com C++ 20 09-07-2009 08:54 PM Jean-Daniel Gamache Java 0 07-14-2004 03:57 AM Andreas VHDL 1 05-04-2004 01:49 PM Bharat Bhushan Java 15 08-05-2003 07:52 PM

Advertisments