close

Problematic code:

int *A;

int B[5];

A = &B;

 

Error massage:

error C2440: '=' : cannot convert from 'int (*)[][]' to 'int *' 

Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

 

Solution:

A = reinterpret_cast<int*> (&B);

arrow
arrow
    全站熱搜

    bamil 發表在 痞客邦 留言(0) 人氣()