>>52
listen if you need to know the size of a buffer you do it like this
struct buffer {
size_t size;
unsigned char *ptr;
};
if you need to know the size of a struct you do this
sizeof(struct sumthin);
if you want to allocate an array it's easy
struct whatever *p = malloc(sizeof(*p) * n);
what exactly are you having problems with... don't know what foreign/future/closed code has to do with anything because if it's closed then you don't NEED to know how much memory something uses because it's not like you can go poking around inside
as for your sentence structure I have a hard time parsing that first sentence it's not like I'm exactly the model of eloquence but I'm just not sure what problem you're having with your programs that you need to figure out the size of an opaque region of memory... besides, you can write your own malloc and add this feature it's not that hard but it will only let you query the size of heap objects not stack objects, obviously
and the ad hominem attacks are a bit puerile, even for these backwaters of the internet... I don't know what code you write so don't go telling me I don't write portable or scalable code for all you know I'm a respectable programmer who just likes to go trolling from time to time hey it could happen