Click here to Skip to main content
15,891,910 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Source Code Editor Control Pin
Software_Developer7-Oct-11 3:44
Software_Developer7-Oct-11 3:44 
AnswerRe: Source Code Editor Control Pin
TheGreatAndPowerfulOz7-Oct-11 3:52
TheGreatAndPowerfulOz7-Oct-11 3:52 
AnswerRe: Source Code Editor Control Pin
TheGreatAndPowerfulOz7-Oct-11 5:17
TheGreatAndPowerfulOz7-Oct-11 5:17 
QuestionThreads Pin
sarfaraznawaz7-Oct-11 0:35
sarfaraznawaz7-Oct-11 0:35 
AnswerRe: Threads Pin
David Crow7-Oct-11 2:55
David Crow7-Oct-11 2:55 
GeneralRe: Threads Pin
Albert Holguin7-Oct-11 5:07
professionalAlbert Holguin7-Oct-11 5:07 
QuestionAccess Violation Problem C++ Builder 2006 Pin
Turhan Coskun7-Oct-11 0:33
professionalTurhan Coskun7-Oct-11 0:33 
QuestionBest way to store Array of Dynamic Objects Pin
002comp6-Oct-11 21:17
002comp6-Oct-11 21:17 
hello Friends

What is Best way to store Array of Dynamic Objects

I am creating a pointer for class A and Initializing 100 objects

And then again I am Initializing 200 objects.

What is Best way to store these arrays.
i used map like map<int,a*> But problem is coming that deleting array pointer is deleting from map also.

My Design Structure is like this

C++
int size =2;
for(int i=0; i<size;i++)
{
   A* objA = new A[100]
   for(int j = 0 ; j<100;j++)
   {
      objA[j].var = TempVar; 
   }
   mapA.insert(make_pair(i,objA));
   
}


But,i am not happy with this way to store array of objects in map .As I am using map as a storage that I can use anywhere in application,and bcoz of not deleting pointer it crashes sometimes.

Suggest me some better way.
Thanks & Regards
Yogesh

AnswerRe: Best way to store Array of Dynamic Objects Pin
Richard MacCutchan6-Oct-11 22:34
mveRichard MacCutchan6-Oct-11 22:34 
AnswerRe: Best way to store Array of Dynamic Objects Pin
_AnsHUMAN_ 6-Oct-11 22:47
_AnsHUMAN_ 6-Oct-11 22:47 
GeneralRe: Best way to store Array of Dynamic Objects Pin
002comp6-Oct-11 22:56
002comp6-Oct-11 22:56 
GeneralRe: Best way to store Array of Dynamic Objects Pin
Stefan_Lang6-Oct-11 23:42
Stefan_Lang6-Oct-11 23:42 
AnswerRe: Best way to store Array of Dynamic Objects Pin
Stefan_Lang6-Oct-11 23:06
Stefan_Lang6-Oct-11 23:06 
GeneralRe: Best way to store Array of Dynamic Objects Pin
002comp7-Oct-11 2:29
002comp7-Oct-11 2:29 
GeneralRe: Best way to store Array of Dynamic Objects Pin
002comp10-Oct-11 18:55
002comp10-Oct-11 18:55 
GeneralRe: Best way to store Array of Dynamic Objects Pin
Stefan_Lang10-Oct-11 23:48
Stefan_Lang10-Oct-11 23:48 
QuestionFunction "WriteAllText" Pin
i52camam6-Oct-11 8:52
i52camam6-Oct-11 8:52 
AnswerRe: Function "WriteAllText" Pin
TheGreatAndPowerfulOz6-Oct-11 8:59
TheGreatAndPowerfulOz6-Oct-11 8:59 
GeneralRe: Function "WriteAllText" Pin
i52camam6-Oct-11 9:06
i52camam6-Oct-11 9:06 
AnswerRe: Function "WriteAllText" Pin
Rajesh R Subramanian6-Oct-11 9:11
professionalRajesh R Subramanian6-Oct-11 9:11 
AnswerRe: Function "WriteAllText" Pin
TheGreatAndPowerfulOz6-Oct-11 9:14
TheGreatAndPowerfulOz6-Oct-11 9:14 
GeneralRe: Function "WriteAllText" Pin
i52camam8-Oct-11 10:07
i52camam8-Oct-11 10:07 
GeneralRe: Function "WriteAllText" Pin
TheGreatAndPowerfulOz10-Oct-11 7:45
TheGreatAndPowerfulOz10-Oct-11 7:45 
QuestionVC++ Excel programing about formatting output??? Pin
Falconapollo6-Oct-11 6:36
Falconapollo6-Oct-11 6:36 
AnswerRe: VC++ Excel programing about formatting output??? Pin
David Crow6-Oct-11 9:34
David Crow6-Oct-11 9:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.