 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Pierre Couderc Guest
|
Posted: Fri Jul 29, 2005 6:40 pm Post subject: Is there a simple (and quick) serialisation method for simpl |
|
|
I want to serialise quickly a "simple" vector :
(simple is to say with basic types and no pointers)
such as :
class c
{
int i,j;
double z;
}
vector<c> cs;
Is there some simple efficient way such as :
memcpy(mybuff, cs , sizeof(what?))...
I am using SGI stl.
Thank you in advance
Pierre Couderc
|
|
| Back to top |
|
 |
Victor Bazarov Guest
|
Posted: Fri Jul 29, 2005 7:52 pm Post subject: Re: Is there a simple (and quick) serialisation method for s |
|
|
Pierre Couderc wrote:
| Quote: | I want to serialise quickly a "simple" vector :
(simple is to say with basic types and no pointers)
such as :
class c
{
int i,j;
double z;
}
;
vector<c> cs;
|
Supposedly you included the proper headers...
| Quote: | Is there some simple efficient way such as :
memcpy(mybuff, cs , sizeof(what?))...
I am using SGI stl.
|
What's "mybuff"?
You should probably do
memcpy(mybuff, &cs[0], cs.size() * sizeof(c));
V
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|