Komischer Fehler bei static_cast??



  • Folgender Code:

    CCollisonSection *p=  static_cast<CCollisonSection*> (pData->pcList.ElementAt(i)->pcCTimeElems.ElementAt(p));
    

    Fehler : error C2664: 'CTypedPtrArray<BASE_CLASS,TYPE>::ElementAt': Konvertierung des Parameters 1 von 'CCollisonSection *' in 'INT_PTR' nicht möglich
    with
    [
    BASE_CLASS=CPtrArray,
    TYPE=CTimeElem *
    ]

    Folgender Code Funktioner obwohl es eigentlich das gleiche ist funktiniert aber warum??:

    CTimeElem *pi= pData->pcList.ElementAt(i)->pcCTimeElems.ElementAt(p);
    CCollisonSection *p=  static_cast<CCollisonSection*> (pi);
    


  • hast den namen p doppelt verwendet. im obigen code gibts das neue p schon.



  • SORRY hat sich erledigt..... jepp das p wars 🙂


Anmelden zum Antworten