$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Beman Dawes (bdawes_at_[hidden])
Date: 2008-05-28 18:09:21
Roland Schwarz wrote:
> Just checked:
> iostream::write
> can't write to a void*
Actually, its expecting a const char*.
>
> This means:
>
> struct A_t {
> ulittle32_t a;
> ulittle32_t b;
> } A;
>
> std::fstream f("test.bin", ios::out|ios::binary);
>
> f.write(&A, sizeof(A_t);
>
> won't compile. And I think one should be able to expect this
> to work for an endian lib.
>
> Or am am I missing something here?
A reinterpret_cast is needed for a struct. It doesn't matter what is
inside the struct.
--beman