JasBascom wrote:
>
> the read problem is fixed with a simple ampersand & before rec. for anyone who
> has the same problem in future, the char only wants an address to start reading
> from.
Since you rewrote the whole thing, you may now need the address of operator.
In the original code you posted, it is not needed and in fact would be
a serious bug. rec already is a pointer, and you don't want read to store
the read bytes in the pointer. Instead you want read to store the read
bytes where rec points to. rec has that address as its value, thus one would
pass rec just the way you did in your original code snippet.
--
Karl Heinz Buchegger