how to use an Array of a class?
-
Hi I have a class named CClipSaver and I want to create an array of this class. I do this as follows:
CClipSaver* Clips[10]; . . . Clips[i]=new CClipSaver; Clips[i]->Save(); . . .
But it crashes! Note: When I do not use array (i.e.
CClipSaver * Clip; Clip=new ClipSaver(); Clip.Save();
) everything works fine. How should I declare and use the array? -
Hi I have a class named CClipSaver and I want to create an array of this class. I do this as follows:
CClipSaver* Clips[10]; . . . Clips[i]=new CClipSaver; Clips[i]->Save(); . . .
But it crashes! Note: When I do not use array (i.e.
CClipSaver * Clip; Clip=new ClipSaver(); Clip.Save();
) everything works fine. How should I declare and use the array? -
What is the value of
i
when it "crashes"? (whatever "crashes" means)
You may be right
I may be crazy
-- Billy Joel --Within you lies the power for good, use it!!!
-
Hi I have a class named CClipSaver and I want to create an array of this class. I do this as follows:
CClipSaver* Clips[10]; . . . Clips[i]=new CClipSaver; Clips[i]->Save(); . . .
But it crashes! Note: When I do not use array (i.e.
CClipSaver * Clip; Clip=new ClipSaver(); Clip.Save();
) everything works fine. How should I declare and use the array?MohammadAmiry wrote:
Clip=new ClipSaver(); Clip.Save(); everything works fine
Hope its a typo Error
Do your Duty and Don't expect the Result
Rate this Post, if I helped You