看板 EE_DSnP 關於我們 聯絡資訊
_numToVertices和**_toVertices的關係是什麼? 看作業說明是說_numToVertices是指向外面的數量 而**toVertices則是指向下一個vertex的指標的指標 所以是要把**toVertices做成array的形式嗎? 目前程式碼看起來是這樣 class Vertex private: size_t _id; size_t _numToVertices; Vertex **_toVertices; }; 那我要如何在construct時就決定**toVertices的陣列大小? 或是toVertices的陣列該如何在construct後決定? ======================== Yes, _toVertices is a "dynamic array of pointers". So it is "**". When reading each line from the input array in Graph::readGraph(), you can determine the _numToVertices and dynamically allocate _toVertices. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.121.128.162
dryman:喔喔,就像是作業七的部份! 12/15 17:09