|
-
August 28th, 1999, 04:35 AM
#1
Studying CTypedPtrArray
I have managed to input data into my CMyClass derived class and add it to MyArrayOfPtrs which was created from CTypedPtrArray<CObArray, CMyClass*>. Assume CMyClass has 3 CString member vars, say m1, m2, & m3. Once I know the zero-based subscript of the myclass, should I be able to reference a member with []? Such as MyArrayOfPtrs[34].m1????? Or is this asking too much. Thanks to anyone who might offer a little explanation!
-
August 28th, 1999, 06:24 AM
#2
Re: Studying CTypedPtrArray
Ok ,
You can use []. But you can't use like "MyArrayOfPtrs[34].m1?????" because you use CMyClass*. It should be MyArrayOfPtrs[34]->m1. Actually it is the same use of CObArray or CPtrArray but it is type safe. Don't forget to allocate the element before adding the element to the array and to deallocate the element after removing that element from the array.
Hnin Yu
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|