求教:为什么总是非法指针
KLSD 2003-08-03 12:05:13 在使用socket的readbuf方法时,
我写了如下代码:
maya *you;
void *in;
tin = Socket->ReceiveBuf(in , Socket->ReceiveLength());(***)
you = (maya *)in;
usa = you->from;
cna = you->str;
执行到(***)这句后,就出现了windows socket error: the system detect an
invalid point address in attempting to use a pointer argument in a
call(10014) , on api "recv" .的错误。
其中maya是自定义的一个struct:
struct test{
AnsiString str;
AnsiString from;
};
typedef struct test maya;
--