Click here to Skip to main content
16,007,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: new and delete, why does this work? Pin
Sam C15-Oct-01 13:46
Sam C15-Oct-01 13:46 
AnswerRe: new and delete, why does this work? Pin
Sam C15-Oct-01 13:48
Sam C15-Oct-01 13:48 
GeneralATL Pin
mimi15-Oct-01 9:13
mimi15-Oct-01 9:13 
GeneralCArray "How to" Pin
RobJones15-Oct-01 7:23
RobJones15-Oct-01 7:23 
GeneralRe: CArray "How to" Pin
Carlos Antollini15-Oct-01 7:38
Carlos Antollini15-Oct-01 7:38 
GeneralRe: CArray "How to" Pin
RobJones15-Oct-01 7:55
RobJones15-Oct-01 7:55 
GeneralRe: CArray "How to" Pin
Carlos Antollini15-Oct-01 8:22
Carlos Antollini15-Oct-01 8:22 
GeneralRe: CArray "How to" Pin
Carlos Antollini15-Oct-01 8:40
Carlos Antollini15-Oct-01 8:40 
I agree with You.
I will give you a simple help.

For example:
The constructor of CArray is:
CArray<TYPE, TYPE>
Never forgot #include <afxtempl.h>

You can define
CArray<int,int> ptArray;
Or
CArray<MyClass, MyClass> ptArray;

ptArray.Add(20); //Add 20 as element 0
ptArray.Add(15); //Add 15 as element 1 in the array

ptArray.InsertAt(0, 23)); // New element 0


int num = ptArray.GetAt(1); //returns the element 1

int nSize = trArray.GetSize(); //returns the number of elements in the array.

you can append a array to another array

for example.
CArray<int, int> oArray;

oArray.Append(ptArray);

with removeAll you can delete all elements in the array.

ptArray.RemoveAll();

with RemoveAt() you can remove n elements in the array.

RemoveAt(nIndex, num)
ptArray.RemoveAt(1, 2); //remove starting from the element 1, two elements.


You Understand????


Best Regards Wink | ;) Wink | ;) Wink | ;) Wink | ;)

Carlos Antollini.Green Alien | [Alien]

Carlos Antollini.
GeneralRe: CArray "How to" Pin
RobJones15-Oct-01 9:20
RobJones15-Oct-01 9:20 
GeneralRe: CArray "How to" Pin
Christian Graus15-Oct-01 10:29
protectorChristian Graus15-Oct-01 10:29 
GeneralRe: CArray "How to" Pin
RobJones15-Oct-01 11:15
RobJones15-Oct-01 11:15 
GeneralRe: CArray "How to" Pin
Christian Graus15-Oct-01 11:34
protectorChristian Graus15-Oct-01 11:34 
GeneralRe: CArray "How to" Pin
Mike Burston15-Oct-01 11:57
Mike Burston15-Oct-01 11:57 
GeneralHelp: Software Distribution in Visual C++ Pin
Agusti15-Oct-01 6:37
Agusti15-Oct-01 6:37 
GeneralRe: Help: Software Distribution in Visual C++ Pin
Carlos Antollini15-Oct-01 6:44
Carlos Antollini15-Oct-01 6:44 
GeneralMFC Extension DLL and Automation support Pin
Paul Selormey15-Oct-01 5:39
Paul Selormey15-Oct-01 5:39 
GeneralPARSING of Command Line Arguments Pin
15-Oct-01 5:23
suss15-Oct-01 5:23 
GeneralRe: PARSING of Command Line Arguments Pin
Michael P Butler15-Oct-01 5:26
Michael P Butler15-Oct-01 5:26 
GeneralRe: PARSING of Command Line Arguments Pin
Chris Losinger15-Oct-01 8:07
professionalChris Losinger15-Oct-01 8:07 
GeneralBackground image in a window? (MFC) Pin
15-Oct-01 4:14
suss15-Oct-01 4:14 
GeneralRe: Background image in a window? (MFC) Pin
Michael P Butler15-Oct-01 4:30
Michael P Butler15-Oct-01 4:30 
GeneralRe: Background image in a window? (MFC) Pin
Paul Selormey15-Oct-01 5:29
Paul Selormey15-Oct-01 5:29 
GeneralHelp !!!!! I am getting bogus poiner problem Pin
15-Oct-01 4:02
suss15-Oct-01 4:02 
GeneralRe: Help !!!!! I am getting bogus poiner problem Pin
Michael P Butler15-Oct-01 4:08
Michael P Butler15-Oct-01 4:08 
GeneralRe: Help !!!!! I am getting bogus poiner problem Pin
15-Oct-01 5:15
suss15-Oct-01 5:15 

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.