FA> So sizeof() will return the length of the pointer.
PW> I seem to get 2...
In small memory model you will get that. Try compiling in large, and you'll get 4.
PW> BTW how can I make a pointer to point to a set place in memory (i.e.
PW> segment and offset) ???
Borland provide a MK_FP macro.
FA> Perhaps if the string is global it may also work, but i didn't try or
FA> even said that !.:)
PW> What's wrong with global variables? :)
Nothing more than global functions.
FA> 2 or 4 bytes (i forget) back from the pointer and you'll find the
FA> alloced block size somewhere, it only seems to work with the Borland
FA> RTL..
PW> What's RTL?
Run Time Library.
PW> BTW I'd rather keep the code as portable as possible (between
Good to see. You should have a bloody good reason not to make it portable,
rather than the other way around. And isolate out the non-portable bits,
either into separate source files, or at least put a #ifdef around it (and
make the #ifdef the non-default, and make it still do *something* on an
ISO-only environment). BFN. Paul.
@EOT:
---
* Origin: X (3:711/934.9)
|