×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Feb 2005
    Posts
    85

    RPointerArray value assignment

    Hi

    For example:
    Code:
    class CMyclass
    {
       .....
    };
    
    RPointerArray<CMyclass>* ptArray1;
    RPointerArray<CMyclass>& ptArray2;
    if ptArray2 has the value, how does the ptArray1 gets the value from ptArray1?

    I tried with *ptArray2 = ptArray1; but I got an error:

    binary '=' : no operator defined which takes a right-hand operand of type 'class RPointerArray<CMyclass>' (or there is no acceptable conversion)

    How can I solve that, thanks!!

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,169
    you should either add the value for the second array, or assign the value for existing item in there. This is anyway C++, so use the class member functions defined (append, insert etc) to make it safe and consistent.

    yucca

  3. #3
    Nokia Developer Expert
    Join Date
    Apr 2003
    Location
    Finland
    Posts
    425
    Hi

    If you really want to make a copy of the _pointer_ of the array, here we go:

    Code:
        CArrayFixFlat<TDesC>* strings1 = new CArrayFixFlat<TDesC>(6);
        CArrayFixFlat<TDesC>** stringsPtr = &(strings1);
        (*stringsPtr)->Count();
    Keep on mind now both arrays have same data.

    Br V

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×