Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Keith Thompson <kst-u@mib.org> |
| Newsgroups | comp.lang.c |
| Subject | Re: C language declaration "bugs" |
| Date | Tue, 11 Oct 2016 10:01:10 -0700 |
| Organization | None to speak of |
| Lines | 18 |
| Message-ID | <ln60oyom5l.fsf@kst-u.example.com> (permalink) |
| References | <90bf0ba6-5094-4551-8cc0-c60214b14362@googlegroups.com> <87d1j7avp8.fsf@bsb.me.uk> <b4976e0d-cedb-4721-a261-d3597eb43b97@googlegroups.com> <87zimb9e5b.fsf@bsb.me.uk> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Injection-Info | mx02.eternal-september.org; posting-host="c91660510313b0b3b2b18aebbb52bfad"; logging-data="23216"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18R56HjlwfBZFvkGhWop1wD" |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
| Cancel-Lock | sha1:MgrroH8whuYNbnws28daAiObUHg= sha1:ZNbBZHLUAvEdfpIa3cW7xMiR6L0= |
| Xref | csiph.com comp.lang.c:94732 |
Show key headers only | View raw
Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
> Thiago Adams <thiago.adams@gmail.com> writes:
[...]
>> I can't find any options to express dynamic arrays in structs.
>
> No, you can't, other than the "struct hack" of putting a flexible array
> member (i.e. an incomplete array declaration) as the last member.
I think the term "struct hack" generally refers to the old technique of
defining an array member of length 0 or 1 at the end of a structure and
treating it as a longer array. Flexible array members, added in C99,
were intended to *replace* the struct hack.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
C language declaration "bugs" Thiago Adams <thiago.adams@gmail.com> - 2016-10-11 05:17 -0700
Re: C language declaration "bugs" Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-10-11 13:58 +0100
Re: C language declaration "bugs" Thiago Adams <thiago.adams@gmail.com> - 2016-10-11 06:47 -0700
Re: C language declaration "bugs" Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-10-11 15:03 +0100
Re: C language declaration "bugs" Thiago Adams <thiago.adams@gmail.com> - 2016-10-11 07:41 -0700
Re: C language declaration "bugs" BartC <bc@freeuk.com> - 2016-10-11 16:31 +0100
Re: C language declaration "bugs" Keith Thompson <kst-u@mib.org> - 2016-10-11 10:01 -0700
Re: C language declaration "bugs" Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-10-11 19:10 +0100
Re: C language declaration "bugs" BartC <bc@freeuk.com> - 2016-10-11 14:14 +0100
csiph-web