我需要将一些代码从FreePascal移植到C中。我是一名专业的C开发人员,但对Pascal一无所知。 大部分代码可以很容易地移植,但是一行代码让我很头疼。 这应该做什么:
New(newBack); curBackPtr^ := newBack; curBackPtr := @(newBack^.next);这里让我感到困惑的是newBack被分配给curBackPtr并且在newBack.next被分配给curBackPtr而没有curBackPtr被访问之后。 是不是第一个任务是多余的,可以安全地删除? 或者我在这里错过了什么?
I need to port some code from FreePascal to C. I'm a professional C developer but know nothing of Pascal. Most of the code can be ported quite easily but one line is giving me a headache. What exactly is this supposed to do:
New(newBack); curBackPtr^ := newBack; curBackPtr := @(newBack^.next);What is confusing me here is the fact that newBack is assigned to curBackPtr and right after that newBack.next is assigned to curBackPtr without curBackPtr ever being accessed. Isn't the first assignment superfluous then and can be safely removed? Or am I missing something here?
最满意答案
更多推荐
发布评论