Re: Safe pointer arithmetic and typecasts :D
From: Bruce Roberts (ber_at_bounceitattcanada.xnet)
Date: 03/31/04
- Next message: Bruce Roberts: "Re: Handling Out Of Memory"
- Previous message: Doug Luie: "Re: Delphi Rox! but..."
- In reply to: Skybuck Flying: "Safe pointer arithmetic and typecasts :D"
- Next in thread: Skybuck Flying: "Re: Safe pointer arithmetic and typecasts :D"
- Reply: Skybuck Flying: "Re: Safe pointer arithmetic and typecasts :D"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 31 Mar 2004 09:53:01 -0500
"Skybuck Flying" <nospam@hotmail.com> wrote in message
news:c4ds2v$4ag$1@news5.tilbu1.nb.home.nl...
> I always wondered how to do safe pointer aritmetic in delphi without
> overflow errors or warnings...
There is no really safe method of doing pointer arithmatic in any language.
But there really isn't a need to use pointers in Delphi unless one is
constructing trees and graphs. In which case pointer arithmatic is not
needed. If you want to index through a linear structure use the tools
available in Delphi. Namely arrays. In the case of text, use the long string
type. It can be indexed as a vector (array) so there is no need for pChar.
The advantage of using array references is that when bounds checking is
turned on the program is going to catch any invalid indexes.
- Next message: Bruce Roberts: "Re: Handling Out Of Memory"
- Previous message: Doug Luie: "Re: Delphi Rox! but..."
- In reply to: Skybuck Flying: "Safe pointer arithmetic and typecasts :D"
- Next in thread: Skybuck Flying: "Re: Safe pointer arithmetic and typecasts :D"
- Reply: Skybuck Flying: "Re: Safe pointer arithmetic and typecasts :D"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|