• 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: C pointer manipulation (was Re: C question for you old guys ;-))
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C pointer manipulation (was Re: C question for you old guys ;-))


  • Subject: Re: C pointer manipulation (was Re: C question for you old guys ;-))
  • From: Martin Häcker <email@hidden>
  • Date: Wed, 25 Jun 2003 23:04:28 +0200

where number evaluates to an integer of some sort (like in your example), your C compiler will actually compute

ptr + number * sizeof type

This behaviour is useful in many cases, but it can be a pain if you just want to do some quick address manipulation, and it sometimes (perhaps even regularly?) surprises newbies.

Well thank you, that's exactly the case.

Hmm.. Well, I'll just try to remember to avoid pointer arithmetic as often as possible. But the few times that you can't go without it... Well I'll try to remember for then.

Thanks again!

cu Martin
--
dont.wanna.tell
[ot]coder - hehe
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >C pointer manipulation (was Re: C question for you old guys ;-)) (From: "Alastair J.Houghton" <email@hidden>)

  • Prev by Date: Re: colon in file names for maildir
  • Next by Date: Re: OCUnit vs OBJCUnit
  • Previous by thread: C pointer manipulation (was Re: C question for you old guys ;-))
  • Next by thread: Re: C question for you old guys ;-)
  • Index(es):
    • Date
    • Thread