ubyte array to uint?

2015-02-05 Thread Gan via Digitalmars-d-learn
Is there a simple way of conversion? Something like: uint length = to!uint(buffer[0 .. 4]); Right now I have: uint length = *cast(uint*)buffer[0 .. 4].ptr; Which I'm not entirely sure is the correct way to do that.

Re: ubyte array to uint?

2015-02-05 Thread weaselcat via Digitalmars-d-learn
On Friday, 6 February 2015 at 05:18:45 UTC, Gan wrote: Is there a simple way of conversion? Something like: uint length = to!uint(buffer[0 .. 4]); Right now I have: uint length = *cast(uint*)buffer[0 .. 4].ptr; Which I'm not entirely sure is the correct way to do that. Hi, check out