r/w binary

Joel Christensen joelcnz at gmail.com
Fri Jul 1 12:01:35 PDT 2011


Ok, I get you. A whole int*, not one byte of the int* data.

- Joel

On 01-Jul-11 6:07 AM, Ali Çehreli wrote:
> On Fri, 01 Jul 2011 05:28:56 +1200, Joel Christensen wrote:
>
>> Shouldn't file.rawWrite((&i)[0..1]); have [0..4]? Or am I missing some
>> thing?
>
> [0..1] follows the regular slicing syntax there: those are element
> indexes. Since&i is an int*, [0..1] slices the first int. It would be
> different if it were ubyte* or void*.
>
> Ali



More information about the Digitalmars-d-learn mailing list