This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How can I initialize an array element in G++?


>>>>> "H" == H J Lu <hjl@lucon.org> writes:

> --x.c--
> static const char*  foo [4] =
> {
>   [2] = "hi",
> };
> --

> I got

> # gcc -c x.c
> # g++ -c x.c
> x.c:3: parse error before `='

> Is there a way to do it in G++?

No, g++ doesn't support that syntax yet.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]