[問題] 如何用struct去要2維陣列?
※ [本文轉錄自 C_and_CPP 看板]
作者: lovec (。口亨。) 看板: C_and_CPP
標題: [問題] 如何用struct去要2維陣列?
時間: Sun Jul 6 04:03:17 2008
我的程式這樣寫 :
struct BR
{
int vote;
int up;
int low;
};
BR **para;
para = new BR *[大小];
for(temp = 0 ; temp < 大小 ; temp++)
para[temp] = new BR [大小];
然後我使用 para[][].vote(或是.up / .low)做運算時都有error,
它告訴我.vote/.up/.low沒有結構 :
(left of '.vote' must have class/struct/union type)
(left of '.low' must have class/struct/union type)
(left of '.up' must have class/struct/union type)
請問我該怎麼要才對??
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.138.179.147
※ lovec:轉錄至看板 ask 07/06 04:03
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.138.179.147