PDA

View Full Version : SOLVED int to binary to qstring



2lights
16th September 2013, 15:04
SOLVED
Apologies

found answer within related forum @
http://www.qtcentre.org/threads/6386-integer-to-its-binary-representation-QString

Kind Regards

Good Day,

How Do I store the binary value of an quint8 in a QString

I know how to output value in binary
as cout << bin << value;

But how do i store that data in QString with padded zero's

Example
value = 35
convert to Binary value = 100011
add zeros in front to make 8bits(assignment requirements)
'00'100011

//The padding i can get right but i first need to store the binary data as QString

#newbie in Binary compilation
Assistance please