我正在使用自定義鏈接列表類的代碼。 List類有以下功能:將指針變量設置爲多個值
void linkedList::expire(Interval *interval, int64 currentDt)
{
node *t = head, *d;
while (t != NULL)
{
if (t->addedDt < currentDt - (interval->time + (((long long int)interval->month)*30*24*3600*1000000)))
{
// this node is older than the expiration and must be deleted
d = t;
t = t->next;
if (head == d)
head = t;
if (current == d)
current = t;
if (tail == d)
tail = NULL;
nodes--;
//printf("Expired %d: %s\n", d->key, d->value);
delete d;
}
else
{
t = t->next;
}
}
}
我不明白的是代碼的函數的第一行:
node *t = head, *d;
它是如何,該代碼編譯?如何將兩個值分配給單個變量,或者這是一些簡寫快捷方式? head是類型爲* node的成員變量,但在其他地方找不到d。