Re: named initialization of structs in a .cpp file
Re: named initialization of structs in a .cpp file
- Subject: Re: named initialization of structs in a .cpp file
- From: "Peter O'Gorman" <email@hidden>
- Date: Fri, 28 Apr 2006 22:16:53 +0900
On Fri, 2006-04-28 at 07:33 -0400, Peter Lau wrote:
> I have a .cpp file but I would like to use the C99 named
> initialization for structs syntax, can I do that?
>
> struct A sa = {.a = 1,.b = 2.3, .c = 'd'};
>
>
> the compiler generates "expected primary-expression before '.' token.
I think you're expecting c99 features from the c++ compiler. This should
work with gcc, and fail with g++ as far as I can tell.
Hope this helps,
Peter
Attachment:
signature.asc
Description: This is a digitally signed message part
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden