Reading bytes and converting to int

joao joao.rab at hotmail.com
Sat Aug 25 12:50:58 PDT 2012


Thanks everyone, I solved the problem.
I didn't understand these bitmanip methods so I searched and 
found a function to do what I wanted:

string b = "\x24\x10\x00\x00";
uint i = byteToInt(b);
uint byteToInt(string b) {
	 return b[0] | b[1] << 8 | b[2] << 16 | b[3] << 24;
}

=> 4132


More information about the Digitalmars-d-learn mailing list