Article View: comp.std.c
Article #2396Re: 3.7.2 External Object Definitions
From: Eyal Lebedinsky
Date: Thu, 07 Feb 1991 06:49
Date: Thu, 07 Feb 1991 06:49
23 lines
1297 bytes
1297 bytes
In <14327:Feb622:47:1391@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:
>Say struct foo's first element points to struct bar, and vice versa.
>Here's how to initialize mutually referencing static structures:
> static struct {
> struct foo f;
> struct bar b;
> } x = {
> { &x.b },
> { &x.f }
> };
>Done. Most compilers will use fixed addresses for &x.b and &x.f, so this
>will be just as efficient as separate static structure declarations.
>
[stuff deleted]
Yes, this would work. It is a practical solution and I may do it. But I
STILL want to know how to do it STRAIGHT, as ANSI intended. After all,
this is comp.std.c, not comp.lang.c.
>---Dan
Technical Details
Message-ID:
<eyal.665909354@echo>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!ames!uhccux!munnari.oz.au!manuel!csc.canberra.edu.au!echo!eyalReferences:
<eyal.665840220@echo> <14327:Feb622:47:1391@kramden.acf.nyu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!ames!uhccux!munnari.oz.au!manuel!csc.canberra.edu.au!echo!eyal From: eyal@echo.canberra.edu.au (Eyal Lebedinsky) Newsgroups: comp.std.c Subject: Re: 3.7.2 External Object Definitions Message-ID: <eyal.665909354@echo> Date: 7 Feb 91 06:49:14 GMT References: <eyal.665840220@echo> <14327:Feb622:47:1391@kramden.acf.nyu.edu> Sender: news@csc.canberra.edu.au Organization: Info Sci & Eng, University of Canberra Lines: 23