Read Byte Array to Integer

monarch_dodra monarchdodra at gmail.com
Fri Nov 22 13:17:55 PST 2013


On Friday, 22 November 2013 at 19:44:56 UTC, Jeroen Bollen wrote:
> On Friday, 22 November 2013 at 19:22:16 UTC, Ali Çehreli wrote:
>> import std.bitmanip;
>> import std.system;
>>
>> void main()
>> {
>>    ubyte[] data = [ 1, 2, 3, 4 ];
>>    assert(data.read!(uint, Endian.littleEndian) == 0x04030201);
>> }
>>
>> Ali
>
> I have std.system included... :s

What is the type of your "data"?


More information about the Digitalmars-d-learn mailing list