FreePascal初学者问题(FreePascal beginners issue)

编程入门 行业动态 更新时间:2024-10-17 00:18:23
FreePascal初学者问题(FreePascal beginners issue)

我需要将一些代码从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?

最满意答案

在这里输入图像描述

enter image description here

更多推荐

本文发布于:2023-08-07 00:08:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1456698.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:初学者   FreePascal   issue   beginners

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!