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);

文章標籤
全站熱搜
創作者介紹
創作者 bamil 的頭像
bamil

My Humble House

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