PDA

View Full Version : integer to its binary representation QString



QiT
2nd April 2007, 17:20
Hi all;

are there any class I can use to convert an integer to its binary representation QString.
I am using
std::bitset<Precision> myStringOfBits=myInteger;

the problem with this method is Precision must be declared constant:

static const unsigned Precision = 8;

:crying:

jacek
2nd April 2007, 22:52
How about:
QString myStringOfBits( QString::number( myInteger, 2 ) );?