I\'m compiling a .c program using gcc compiler on linux,
But , i received the error shown as \"error: lvalue required as left operand of assignment\"
The er
Your code is nonsensical. Try
saddr_size = (int)(*data2.ssize);
But ... why is saddr_size declared int? Try
socklen_t saddr_size;
...
saddr_size = *data2.ssize;
I also wonder why ssize is a pointer, rather that the size itself.
try changing it like
*(socklen_t*)&saddr_size=*(data2.ssize)
In C, an lvalue is a "left" value, which means a token to which it is valid to assign a value. So the compiler is telling you that the token on the left side of an assignment expression is not valid.
The left value you have cast it to a socklen_t * pointer type, however the right value is socklen_t type, so this error is printed. I have the same question as Jim Balter, you should make sure the socklen_t type can be expressed by int. I mean if int is 32 bytes, would socklen_t be more than 32 bytes? You should declare saddr_size socklen_t type