Paolo Montegriffo wrote:
> I know that I cannot perform arithmetic on a void * pointer, but can I
> do something like:
> void *base1;
> void *p1;
> size_t i, size;
> p1 = base1 + i * size;
I thought you just said you know that arithmetic on a
void* is not allowed. What would be the width of an
element of type void, if there were such a thing in
Standard C? It would have to be 0, so the arithmetic
would be useless anyway.
I *think* that what you want could be obtained by
casting the void* to char* and doing the arithmetic
on that, then casting backing to void*.
comp.lang.c.moderated - moderation address: firstname.lastname@example.org -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.