efficient way of saving class objects ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kenneth6
    New Member
    • Mar 2007
    • 79

    efficient way of saving class objects ?

    if i have a class (A) storing 2 numbers, and i have another class (B) storing an array of 100 class A objects.

    to do a "save" function, how can i do that task with the highest efficiency ?
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    Originally posted by kenneth6
    if i have a class (A) storing 2 numbers, and i have another class (B) storing an array of 100 class A objects.

    to do a "save" function, how can i do that task with the highest efficiency ?
    You would probably want to serialize it. Search for serialization on google or MSDN.

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      You might also read the article on the Visitor desgin pattern in the C/C++ HowTos forum. Toward the end is an example of how to implement a serialize method on a class that doesn't have such a method.

      Comment

      Working...