Re: C pointer manipulation (was Re: C question for you old guys ;-))
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.