0
我敢肯定,這已被問到之前,但搜索「C++」「指針」「功能」「數組」讓我無處可去。C++基本雙指針傳遞
我在主宣佈一些東西,看起來像這樣:
struct point{
float x;
float y;
int m;
float points[10];
point *next;
};
struct neighbor{
float dist;
point *pt;
};
neighbor **candidate = NULL;
而且我想通過「候選人」的功能,這樣我可以做的:
candidate = new neighbor*[10];
for(int i = 0;i<10;i++)
candidate[i] = new neighbor;
注滿水!各種數據,然後退出函數,而不使用return語句(這很重要,因爲我使用的boost線程不能使用void以外的函數),並讓主函數能夠看到函數所做的更改。
對不起,這是如此基本,但我認爲是正確的是不工作,我似乎無法找到我在找什麼。 由於提前