C++ writing int to binary file

Jessie Morris jessie at confettiantiques.com
Mon Apr 27 21:29:44 MDT 2009


On Monday 27 April 2009 9:23:13 pm Byron Clark wrote:
> On Mon, Apr 27, 2009 at 08:52:20PM -0600, Jessie Morris wrote:
> > file.write(reinterpret_cast<char *>(items),sizeof(int));
>
> Assuming that items is an int, you'll probably want &items instead of
> items.
That was EXACTLY what was wrong. But so that I understand what was going on, 
why is that needed?

-- 

Jessie Morris


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://plug.org/pipermail/plug/attachments/20090427/a3d03098/attachment.bin 


More information about the PLUG mailing list