老實說,我想不出這個問題更好的標題,因爲我有2個問題,我不知道原因。傳遞一個浮點數作爲指針的一個矩陣
的第一個問題我已經是這個
//global declaration
float g_posX = 0.0f;
.............
//if keydown happens
g_posX += 0.03f;
&m_mtxView._41 = g_posX;
我得到這個錯誤
cannot convert from 'float' to 'float *'
所以我假設矩陣只接受指針。所以我改變varible這個....
//global declaration
float *g_posX = 0.0f;
.............
//if keydown happens
g_posX += 0.03f;
&m_mtxView._41 = &g_posX;
,我得到這個錯誤
cannot convert from 'float' to 'float *'
這是相當多說,我不能宣佈g_posX作爲指針。
老實說,我不知道該怎麼辦。
向我們展示m_mtxView的聲明和類型。但是,您當前的代碼仍然有與[上一個問題]相同的問題(http://stackoverflow.com/questions/2802418/pointer-on-left-needs-integral-value-on-right)。 – 2010-05-10 12:38:32
你爲什麼一直試圖把一切都解決掉? – sepp2k 2010-05-10 12:39:11
矩陣的定義是什麼? – zebrabox 2010-05-10 12:39:11