Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FreePascal beginners issue

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?

like image 499
Andreas Avatar asked May 04 '26 12:05

Andreas


1 Answers

enter image description here

like image 143
Russell Zahniser Avatar answered May 07 '26 22:05

Russell Zahniser



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!