<分区>
Possible Duplicate:
What can I use instead of the arrow operator,->
?
What does -> mean in C++?
所以我目前正在学习有关数据结构和算法开发的 C++ 考试。在查看我的老师的幻灯片时,我注意到他经常使用这个“->”。而且我不确定这是什么意思?它真的是你可以在 C++ 中执行的命令吗?
示例 1
addrInfo *ptr = head;
while (ptr->next != NULL)
{
ptr = ptr->next;
}
// at this point, ptr points to the last item
示例 2
if( head == NULL )
{
head = block;
block->next = NULL;
}