编辑(现在您发布了代码)
next=actual->next;
delete actual;
actual=next;
那将设置actual为actual.next. 你不能只做
actual=actual->next;
因为那将是内存泄漏(你永远不会删除旧的actual)。此外,你不能只做
next=actual.next;
因为actual是指针。因此你必须得到它指向的东西,比如
next=(*actual).next;
但->运营商正是这样做的,所以你可以这样做
next=actual->next; // means the same thing as "next=(*actual).next;"
(原帖)
意思是一样的
b = (*a).b;
它将局部变量设置b为指针的a值b。例如:
MyClass *a = new MyClass;
// do stuff with *a
int b;
b = a -> b; // gets the `b` value of `a` (assuming MyClass has a public int b)
// same as "b = (*a).b;"