Jump to content
  • Advertisement
Sign in to follow this  
codehunter13

Serialize arrays

This topic is 4855 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, i'm writing a serialize system for my engine. If i want to seialize something,i've just to write: Serializer << objToSerialize; if i look at the boost serialize library i see they can serialize an array with the same call (Serializer << array;) i also wants this but how can i get the size of the array? thx in advance

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by deathwearer
If you want the size of the array just use sizeof()


sizeof does not work that way.

As for the OP, maybe you should use vectors or some other sequential data structure class provided by STL.

Share this post


Link to post
Share on other sites
Boost::serialize only does it with an array if it's actually an array rather than a pointer (in which situation the length can be trivially calculated with sizeof). It can't do it with an array which is passed as a pointer, at least not automatically.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!