• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
named initialization of structs in a .cpp file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

named initialization of structs in a .cpp file


  • Subject: named initialization of structs in a .cpp file
  • From: Peter Lau <email@hidden>
  • Date: Fri, 28 Apr 2006 07:33:53 -0400

I have a .cpp file but I would like to use the C99 named initialization for structs syntax, can I do that?

struct A {
int a;
float b;
char c;
};

struct A sa = {.a = 1,.b = 2.3, .c = 'd'};

the compiler generates "expected primary-_expression_ before '.' token.

Thanks.


 _______________________________________________
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

  • Follow-Ups:
    • Re: named initialization of structs in a .cpp file
      • From: Chris Espinosa <email@hidden>
    • Re: named initialization of structs in a .cpp file
      • From: "Peter O'Gorman" <email@hidden>
  • Prev by Date: Zooming and resizing
  • Next by Date: Editor weirdness
  • Previous by thread: Zooming and resizing
  • Next by thread: Re: named initialization of structs in a .cpp file
  • Index(es):
    • Date
    • Thread