![]() |
Forward deklaration eines Record
Hi,
Ich stehe gerade auf dem Schlauch, wie kann ich zwei Records deklaration die sich rekursiv aufrufen:
Delphi-Quellcode:
:gruebel:
type
aa = record aa: bb; end; type bb = record bb: aa; end; lg Win32 |
Re: Forward deklaration eines Record
Delphi-Quellcode:
So eventuell. Aber das wird nicht funktionieren, weil du da eine Endlosrekursion im Compiler hättest und der das merkt und dir ein "Typ bb nicht vollständig definiert" ausspuckt. Du musst das mit Pointern machen.
type
bb = record; aa = record aa: bb; end; bb = record bb: aa; end; |
Re: Forward deklaration eines Record
So hatte ich es auch schon probiert, danke trotzdem. Pointer ftw :>
lg |
Re: Forward deklaration eines Record
Delphi-Quellcode:
type
pbb = ^bb; paa = ^aa; aa = record aa: pbb; end; bb = record bb: paa; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 19:23 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz