• 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: [OT] A bit confused on pointers...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OT] A bit confused on pointers...


  • Subject: Re: [OT] A bit confused on pointers...
  • From: Steve Bird <email@hidden>
  • Date: Fri, 30 Dec 2005 09:01:09 -0500


On Dec 30, 2005, at 5:10 AM, Andreas Mayer wrote:
it's customary to write int *ptr instead of int* ptr, which would be more accurate in my opinion. The '*' modifies the type, after all, not the identifier.

Coming from Pascal (where you are forced to write var p: ^integer), this made perfect sense to me, UNTIL I discovered that it doesn't work the way I thought it would.

In Pascal, var p1,p2: ^integer declares TWO pointers to integers, but in C, int* p1, p2 does NOT. As much as it makes sense to read it that way, the compiler sees it otherwise.


----------------------------------------------------------------
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: [OT] A bit confused on pointers...
      • From: Alastair Houghton <email@hidden>
References: 
 >[OT] A bit confused on pointers... (From: Sanri Parov <email@hidden>)
 >Re: [OT] A bit confused on pointers... (From: Camillo Lugaresi <email@hidden>)
 >Re: [OT] A bit confused on pointers... (From: Andreas Mayer <email@hidden>)
 >Re: [OT] A bit confused on pointers... (From: Clark Cox <email@hidden>)
 >Re: [OT] A bit confused on pointers... (From: Andreas Mayer <email@hidden>)

  • Prev by Date: autosize an nsimageview programmatically
  • Next by Date: Re: [OT] A bit confused on pointers...
  • Previous by thread: Re: [OT] A bit confused on pointers...
  • Next by thread: Re: [OT] A bit confused on pointers...
  • Index(es):
    • Date
    • Thread