Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to serialize multidimensional CArray objects?

Posted on 1998-01-27
7
Medium Priority
?
480 Views
Last Modified: 2013-11-19
I have developped an application that uses multidimensional CArray objects. I need to save these arrays and I haven't found the way to do it. The CArrays contain mainly double numbers.
Tle arrays are initialized so;

typedef CArray <double,int> OneInPattern;
CArray <OneInPattern,OneInPattern&> InPattern;

Any cue?

Thanks

Marisol
0
Comment
Question by:Marisol
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 

Author Comment

by:Marisol
ID: 1314930
Edited text of question
0
 
LVL 7

Expert Comment

by:galkin
ID: 1314931
CArray is actually derived from CObject so you can take advantage of Serialize function and << and >> operators
0
 

Author Comment

by:Marisol
ID: 1314932
I have that already and it didn't work.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 11

Expert Comment

by:mikeblas
ID: 1314933
Your declaration is bogus.

You've declared a CArray that uses an index of integers to store doubles, which is natural enough. You've typedef'ed that to be called OneInPattern.  You can do things like this:

   OneInPattern array;
   array[3] = 3.1415929;

You've then declared a CArray that uses an index of references to CArrays and stores other CArrays. That's entirely bogus.

Don't you really mean to code:

   typedef CArray <double,int> OneInPattern;
   CArray <OneInPattern&, int> InPattern;

?  That way, you can do things like this:

   // set [3][5] to 2.17.
   InPattern[3].SetAt(5, 2.17);

.B ekiM

0
 
LVL 1

Expert Comment

by:atari
ID: 1314934
I have a full class developed for my own project called CDouble2dArray. With it you can simply create multidimensional double-arrays. If you change to int, word ... you can easily create new multidimensional arrays like CInt2dArray. I can also serialize this multidimensional arrays. If you want the complete .cpp-file send me an email at MKuelsh@aol.com.

Hope this helps
0
 
LVL 1

Accepted Solution

by:
atari earned 200 total points
ID: 1314935
I have put a new answer to this question, now you can grade if you like ?!

Haven't you got my email, I send to you the last days ?

Bye,
atari

0
 
LVL 1

Expert Comment

by:atari
ID: 1314936
How about grading, Marisol ?

Bye,
atari
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question