• 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: Andreas Mayer <email@hidden>
  • Date: Fri, 30 Dec 2005 11:10:19 +0100


Am 29.12.2005 um 21:39 Uhr schrieb Clark Cox:

what is confusing about the syntax?

If (ptr) is a pointer, then (*ptr) is whatever it points at

Umm... what's *not* confusing about that syntax?

* is usually associated with multiplication.

And as Pontus pointed out, it doesn't help that the same symbol is used in the declaration of pointers. To make things worse, 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.

Then there is the & operator, which is often used in conjunction with pointers; and of course, this character does have a different meaning when used as a binary operator. To make things worse, there's also &&.

It would be so much more readable if pointers where just declared as int pointer myPointer and dereferenced like deref(myPointer) or something like that.

Actually I don't like the C declaration syntax anyway. There should be a special character clearly separating the type from the identifier.

int pointer: myPointer;


But this is all really off topic and C will not change, no matter how much we discuss it.


Andreas
_______________________________________________
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: Steve Bird <email@hidden>
    • Re: [OT] A bit confused on pointers...
      • From: Camillo Lugaresi <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>)

  • Prev by Date: Re: bayesian filter?
  • Next by Date: Re: Tiger Mail.app style toolbar item
  • Previous by thread: Re: [OT] A bit confused on pointers...
  • Next by thread: Re: [OT] A bit confused on pointers...
  • Index(es):
    • Date
    • Thread