🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.lang.c
Article #15570

Re: alignements struct/tableaux

#15570
From: Antoine Leca
Date: Mon, 19 Sep 2005 12:48
47 lines
2661 bytes
En <news:432d35cb$0$9448$626a14ce@news.free.fr>,
Pierre Habouzit va escriure:
> Harpo wrote:
>
>> Pierre Habouzit wrote:
>>> struct message {
>>>     [ ... pleins de choses dont pas mal de 'headers' ...];
>>>     struct {
>>>         const blob_t *original;
>>>         blob_t *scratch;
>>>     };
>>
>> Pourquoi garder la structure au dessus, et -peut-�tre suis-je mal
>> r�veill�- comment y acc�der sans la nommer ?
>
> bah tu peux y acc�der par hdr->scratch.

C>type struct.C
typedef int blob_t[5];

struct message {
     struct {
         const blob_t *original;
         blob_t *scratch;
     };
} *hdr;


int main() {

        hdr->scratch;
        return 0;
}

C>bin\gcc -v -ansi struct.c
Reading specs from bin/../lib/gcc/mingw32/3.4.2/specs
[couic]
GNU C version 3.4.2 (mingw-special) (mingw32)
        compiled by GNU C version 3.4.2 (mingw-special).
[couic]

struct.c:7: warning: declaration does not declare anything
struct.c: In function `main':
struct.c:13: error: structure has no member named `scratch'


Antoine
Technical Details
Message-ID: <dgmc3m$63j$1@shakotay.alphanet.ch>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!solnet.ch!solnet.ch!news.imp.ch!news.imp.ch!80.83.46.147.MISMATCH!news.alphanet.ch!alphanet.ch!not-for-mail
References: <432c52d5$0$9425$626a14ce@news.free.fr> <mn.8cb87d59c7031bee.15512@YOURBRAnoos.fr> <432c688a$0$14382$626a14ce@news.free.fr> <432c6c63$0$17061$8fcfb975@news.wanadoo.fr> <432c77ed$0$12670$626a14ce@news.free.fr> <432d0eca$0$5402$8fcfb975@news.wanadoo.fr> <432d35cb$0$9448$626a14ce@news.free.fr>

Show Full Headers
Complete Article Headers
X-Google-Thread: f9822,2ab126dba8e5e645
X-Google-Attributes: gidf9822,public
X-Google-Language: ENGLISH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!solnet.ch!solnet.ch!news.imp.ch!news.imp.ch!80.83.46.147.MISMATCH!news.alphanet.ch!alphanet.ch!not-for-mail
From: "Antoine Leca" <root@localhost.invalid>
Newsgroups: fr.comp.lang.c
Subject: Re: alignements struct/tableaux
Date: Mon, 19 Sep 2005 14:48:53 +0200
Organization: Posted through ALPHANET (http://www.alphanet.ch/)
Lines: 48
Sender: antoinel@143.red-217-127-250.pooles.rima-tde.net
Message-ID: <dgmc3m$63j$1@shakotay.alphanet.ch>
References: <432c52d5$0$9425$626a14ce@news.free.fr> <mn.8cb87d59c7031bee.15512@YOURBRAnoos.fr> <432c688a$0$14382$626a14ce@news.free.fr> <432c6c63$0$17061$8fcfb975@news.wanadoo.fr> <432c77ed$0$12670$626a14ce@news.free.fr> <432d0eca$0$5402$8fcfb975@news.wanadoo.fr> <432d35cb$0$9448$626a14ce@news.free.fr>
NNTP-Posting-Host: 143.red-217-127-250.pooles.rima-tde.net
Mime-Version: 1.0
Content-Type: text/plain;
 charset="iso-8859-15"
Content-Transfer-Encoding: 8bit
X-Trace: shakotay.alphanet.ch 1127134134 6259 217.127.250.143 (19 Sep 2005 12:48:54 GMT)
X-Complaints-To: usenet@alphanet.ch
NNTP-Posting-Date: Mon, 19 Sep 2005 12:48:54 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506