• 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
anonymous structs in union
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

anonymous structs in union


  • Subject: anonymous structs in union
  • From: Luigi Castelli <email@hidden>
  • Date: Wed, 6 Jun 2007 00:02:16 -0700 (PDT)

Hi there,

I have an union declaration as follows:

typedef union _vec3
{
    struct {
        float x,y,z;
    };
    struct {
        float s,t,r;
    };
    float values[3];

} t_vec3;

When I use the following code:

t_vec3 vector;

vector.x = 1;
vector.y = 2;
vector.z = 3;

X-code complains with this error:

error: t_vec3' has no member named 'x'
error: t_vec3' has no member named 'y'
error: t_vec3' has no member named 'z'

Does xcode have an option to support anonymous structs and unions ?

Thank you.

- Luigi


------------------------------------------------------------
THIS E-MAIL MESSAGE IS FOR THE SOLE USE OF THE INTENDED RECIPIENT AND MAY CONTAIN CONFIDENTIAL AND/OR PRIVILEGED INFORMATION.  ANY UNAUTHORIZED REVIEW, USE, DISCLOSURE OR DISTRIBUTION IS PROHIBITED.  IF YOU ARE NOT THE INTENDED RECIPIENT, CONTACT THE SENDER BY E-MAIL AT email@hidden AND DESTROY ALL COPIES OF THE ORIGINAL MESSAGE. WITHOUT PREJUDICE UCC1-207.
------------------------------------------------------------



      ____________________________________________________________________________________
Park yourself in front of a world of choices in alternative vehicles. Visit the Yahoo! Auto Green Center.
http://autos.yahoo.com/green_center/
 _______________________________________________
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: anonymous structs in union
      • From: Peter Mulholland <email@hidden>
  • Prev by Date: Re[2]: Editing pbxproj manually
  • Next by Date: Re: anonymous structs in union
  • Previous by thread: Xcode CVS compare problem
  • Next by thread: Re: anonymous structs in union
  • Index(es):
    • Date
    • Thread