Re: Safe pointer arithmetic and typecasts :D

From: Skybuck Flying (nospam_at_hotmail.com)
Date: 03/31/04


Date: Wed, 31 Mar 2004 17:30:41 +0200


"Bruce Roberts" <ber@bounceitattcanada.xnet> wrote in message
news:L2Bac.54630$1A6.1209395@news20.bellglobal.com...
>
> "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.

Lol, you too funny :)

Trust me, for my requirements it's absolutely 100% needed :D

Using arrays and indices instead would make it even more difficult. ;) :D



Relevant Pages

  • Re: How to make Delphi code quicker
    ... is simply no way to speed up Delphi code without ... you can get a lower time complexity by allowing a higher memory complexity. ... If you are working with arrays: use helper arrays, one dimension smaller, for caching. ... Don't address the same array element over and over again, instead push it in a variable. ...
    (borland.public.delphi.language.basm)
  • Re: IP Level Encryption
    ... wasn't my point that you should avoid C and use Delphi ... than in C with its string type and dynamic arrays. ... Judging by a lot of code out there, fixed-length arrays are common ... strings (as in an array of chars, not the string type) are quite rare unless ...
    (sci.crypt)
  • C++-DLL in Delphi nutzen
    ... Ich binde eigene mit Delphi erzeugte DLL's dynamisch wie folgt in mein ... Spl: TSplProc; ... Verwende ich statische Arrays, so funktionierts auch. ... Oder geht das Ganze gar nicht mit dynamischen Arrays? ...
    (de.comp.lang.delphi.misc)
  • Re: Compiler optimisation
    ... and C++ compiler that can beat Delphi 5-10x ... in floating point and integer math that uses arrays. ... The only are where Delphi is still "in class" ...
    (borland.public.delphi.non-technical)