ubyte array to uint?

Gan via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Feb 5 21:18:43 PST 2015


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.


More information about the Digitalmars-d-learn mailing list