[Numpy-discussion] moving C++ binary data to numpy

David david at silveregg.co.jp
Mon Feb 7 19:30:17 EST 2011

On 02/08/2011 03:52 AM, Ilya Shlyakhter wrote:
> Is there a portable way to save vector of C++ structs to a binary
> file

C++ structs are not portable, so that sounds difficult. In practice, you 
have compiler-specific ways to enforce some alignement within a 
structure, but that sounds rather nightmarish to support.

Why can't you use a library with a portable file format (e.g. hdf5), or 
something like google protocol buffer/thrift/etc... ? Those are designed 
to solve your problem



More information about the NumPy-Discussion mailing list