-6
我有這樣的結構:轉換malloc的新的C++結構
struct problem
{
int length;
struct node **x;
};
,我創造了這個結構的這樣一個結構:
struct problem prob;
我可以在C這樣做:
prob.x = Malloc(struct node *,prob.length);
但我怎麼能用c + +風格與new
?爲什麼?
向我們展示失敗的代碼。 – Erbureth
是'Malloc'你自己的功能嗎? 'malloc'只能用於一個參數 – mch
'prob.x = new node * [prob.length]'? – 101010