0
我的結構是這樣的:指定地點
struct Node
{
int value;
struct Node *children[26];
};
typedef struct Node *List;
我想配第一(主)結構變量(或指針),所以我會回來給它(在移動到'substructs'後)。即
start = malloc(sizeof(struct Node));
(this variable) = start;
list = (this variable);
list = list -> children[25];
...
list = (this variable) //We're again in main/first struct.
問題是,一旦你改變了'list'指向原來的'list-> children [25]',你就失去了對原始的引用。如果你有'temp = list;'然後'temp = list-> children [25];'等等,你保留原始引用。 –