Re: Dynamic Array and Invalid Pointer
Date: Wed, 28 Apr 2004 22:02:00 +0200
At 20:53:03, 28.04.2004, zdrakec wrote:
> Alas, I have tried this also. Same result.
> "zdrakec" wrote in message
> > If I attempt to free the [dynamic] array with
> > (dtID := nil);
> That's no way to treat an array. An array is not a pointer, didn't
> anybody tell you? Just SetLength it to zero elements.
dtID := nil;
is a valid way of getting rid of (or actually, decrementing the reference
count of) a dynamic array. After all, a dynamic array *is* a pointer.
"Egotist: a person more interested in himself than in me."
- Ambrose Bierce (1842-1914)
- Re: char **argv & char *argv
... "pointer to pointer to char". ... >> pointer)) pointing to the first element of an array. ... so we have to start adding more context. ... type "pointer to char", rather than "array MISSING_SIZE of char". ...
- Re: Array of classes
... >class CSomeclass ... >Then in the code I create a pointer to this class definition ... to an array of objects of some given size n, you'd have to set things up as ... treating elements of the MyClass dynamic array as if they were each a ...
- Re: Who owns the variable in my header file ?
... to check the subscripts to the array and trap on error conditions. ... cast one type of pointer into another; you wouldn't then be able to step ... language trying to be C like, ... One reason being that the programmer can possible ...
- Re: How can I quickly copy a CONST to a typed VAR
... Or an invalid pointer ... A dynamic array is lain out like this in memory: ... ElementCount aren't there. ... without the bookkeeping information that a dynamic array has. ...
- Re: why cannot assign to function call
... hypothetical C-like languages, ... sizeof business would still indicate that a pointer was being passed. ... talk about variables of an array type. ... the earlier version of the standard didn't have numbered ...