Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!rutgers!ukma!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Array intialization Message-ID: <10359@smoke.BRL.MIL> Date: 5 Jun 89 11:28:13 GMT References: <3420@ihuxv.ATT.COM> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 12 In article <3420@ihuxv.ATT.COM> bareta@ihuxv.ATT.COM (Benyukhis) writes: >The following declaration is illegal. Why?????? >char *a = "string1"; >char *b = "string2"; >char *c = "string3"; >char *g[] = { a, b, c }; If the declaration has file scope, so that the variable `g' has static storage duration, then the problem is that initializers must be constants, not contents of variables. If the declaration has block scope, then the problem is that run-time initialization of auto aggregates isn't supported by your compiler.