[fpc-pascal] Why use pointers to arrays?

"Vinzent Höfler" JeLlyFish.software at gmx.net
Mon Oct 12 22:34:58 CEST 2009


Andrew Brunner <andrew.t.brunner at gmail.com>:

> On Sun, Oct 11, 2009 at 5:25 PM, "Vinzent Höfler"
>
> Read up on forward declarations.  The technique of declaring a typed
> pointer to any data structure in FPC and Delphi was that you can use
> it in fields and methods of objects and data structures w/o having to
> actually have it fleshed out until later in the interface envelope of
> the unit.   I've found that using forward declarations is a saving
> grace with complicated systems.

Oh, you're talking about what I call "incomplete type"? ;)

I always was under the impression that the pointed-to-type being declared must be completed in the same declaration section, has that changed? If not, I fail to see the benefit, because you still have to complete the type in the same scope. Which is technically the same as directly declaring it in the first place (unless it's self-referencing, of course).


Vinzent.
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01



More information about the fpc-pascal mailing list