• 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
Re: Struct Data Types
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Struct Data Types


  • Subject: Re: Struct Data Types
  • From: Andrew Farmer <email@hidden>
  • Date: Thu, 16 Aug 2007 18:35:54 -0700

On 16 Aug 07, at 18:25, Richard Somers wrote:
On Aug 16, 2007, at 7:08 PM, Andrew Farmer wrote:
(NSRect) is a structure; (NSRect *) is a pointer to a structure.

I thought (NSRect) was a pointer to a structure because in NSGeometry.h we find the following.


    typedef struct _NSRect {
        NSPoint origin;
        NSSize size;
    } NSRect;

    typedef NSRect *NSRectPointer;

I guess I do not understand the what the second typedef does or how it is used.

It declares that the type NSRectPointer is a pointer to a NSRect. Hence,

	NSRect *rp;

is functionally equivalent to

	NSRectPointer rp;

This doesn't affect the definition of NSRect, though.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Struct Data Types
      • From: Richard Somers <email@hidden>
References: 
 >Struct Data Types (From: Richard Somers <email@hidden>)
 >Re: Struct Data Types (From: Andrew Farmer <email@hidden>)
 >Re: Struct Data Types (From: Richard Somers <email@hidden>)

  • Prev by Date: Re: Struct Data Types
  • Next by Date: Re: Struct Data Types
  • Previous by thread: Re: Struct Data Types
  • Next by thread: Re: Struct Data Types
  • Index(es):
    • Date
    • Thread