Yazan D: On Saturday, 16 January 2016 at 14:42:27 UTC, Yazan D wrote:
ubyte[] b = (cast(ubyte*) &a)[0 .. int.sizeof];
Better to use the actual size: ubyte[] b = (cast(ubyte*) &a)[0 .. a.sizeof]; Bye, bearophile
bearophile via Digitalmars-d-learn Sat, 16 Jan 2016 07:46:37 -0800
Yazan D: On Saturday, 16 January 2016 at 14:42:27 UTC, Yazan D wrote:
ubyte[] b = (cast(ubyte*) &a)[0 .. int.sizeof];
Better to use the actual size: ubyte[] b = (cast(ubyte*) &a)[0 .. a.sizeof]; Bye, bearophile