Aucbvax.5620
fa.unix-wizards
utzoo!decvax!ucbvax!unix-wizards
Sun Dec 27 16:33:25 1981
arrays in structures
>From alice!ark@Berkeley Sun Dec 27 16:20:40 1981
They are legal, and if they don't work then you must have a buggy compiler.
Example:  I should be able to say:

       struct {
               int a;
               char b[25];
               int c;
       } foo[30];

This allocates space for 30 instances of a structure containing an
int, 25 chars, some padding (1 byte on a PDP-11, 3 bytes on a VAX),
and another int.  I can refer to things like:

       foo[15].a
       foo[x].b[y]

and so on.  I know of no particular bugs that would cause trouble here.

-----------------------------------------------------------------
gopher://quux.org/ conversion by John Goerzen <[email protected]>
of http://communication.ucsd.edu/A-News/


This Usenet Oldnews Archive
article may be copied and distributed freely, provided:

1. There is no money collected for the text(s) of the articles.

2. The following notice remains appended to each copy:

The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996
Bruce Jones, Henry Spencer, David Wiseman.