Re: void * pointer convert problem.



tmp123 <tmp123@xxxxxxxxx> wrote:

> a) If the field key has the same offset in both strutures (proc and
> exec), then you can use anyone:

I don't believe that's a portable assumption. The structures could
have different padding bits, so unless key is the first element (in
which case all is well, as structs can always be converted into a
pointer to their first element),

> if (key < (proc_timing_bin_p *)bPtr->key ) ...

need not work. It still doesn't fix OP's other problem, in which he
attempted to increment the void pointer.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
.