save and load a 2d array to a file

bauss jj_1337 at live.dk
Tue Apr 19 08:46:15 UTC 2022


On Tuesday, 19 April 2022 at 06:05:27 UTC, Ali Çehreli wrote:
>
>   int i = 42;
>   file.rawWrite(*cast((int[1]*)(&i)));  // Casted to be an 
> array of 1
>

I assume since we don't have a rawWriteValue, that it's rarely 
needed.

However it should be fairly trivial like:

void rawWriteValue(T)(T value)
{
   rawWrite(*cast((T[1]*)(&value)));
}

Or is there some downside to this that I'm missing?


More information about the Digitalmars-d-learn mailing list