M
Michael B. Allen
Coming from C and Java on *nix I'm a little out of my element messing around
with CList and MSVC++ but I think my issues are largely syntactic.
I have an ADT that I use called a 'varray' that can return a pointer to an
arbirary sized element in an array given an index and it will allocate the
memory to back it if necessary:
struct varray *tests = varray_new(sizeof(struct test));
struct test *t = (struct test *)varray_get(tests, 50));
The point being I don't have to allocate the memory for *t. Each element in
the backing array is sizeof(struct test).
Is there an equivalent ADT in C++ that I should use?
Thanks,
Mike
ref: http://www.ioplex.com/~miallen/libmba/dl/src/varray.c
with CList and MSVC++ but I think my issues are largely syntactic.
I have an ADT that I use called a 'varray' that can return a pointer to an
arbirary sized element in an array given an index and it will allocate the
memory to back it if necessary:
struct varray *tests = varray_new(sizeof(struct test));
struct test *t = (struct test *)varray_get(tests, 50));
The point being I don't have to allocate the memory for *t. Each element in
the backing array is sizeof(struct test).
Is there an equivalent ADT in C++ that I should use?
Thanks,
Mike
ref: http://www.ioplex.com/~miallen/libmba/dl/src/varray.c