const in array bound expression

Henry Spencer henry at utzoo.uucp
Sat Aug 6 03:32:47 AEST 1988


In article <123 at peritus.UUCP> preston at peritus.UUCP (Preston Gardner) writes:
>    const int agg[] = { 1, 1, 2, 3, 5, 8, 13, 21, 34 };
>    int a[agg[4]];

Check the restrictions on the operands permissible in constant expressions;
I believe you will find that "agg" is not legal in an integer constant
expression, which is what's wanted in that context.

(At least, this is the way it is in the January draft; I have no idea what
the May draft says, since I haven't seen it yet.  Grr.)
-- 
MSDOS is not dead, it just     |     Henry Spencer at U of Toronto Zoology
smells that way.               | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list