The reason you got lvalue errors is because you cannot assign a single value to an entire array. An lvalue(left value) is a variable that can receive the rvalue(right variable), which is what the stuff to the right of the assignment operator (=) is.
So a constant cannot be an lvalue (from "left value" because it's on the left of the assignment), nor can a struct, nor can an array, etc. Only something that can store the value that the rvalue evaluates to. Some languages allow you to assign to a substring, so they would consider a substring to be an lvalue.
Try using pointer. Because this usually happens when an equal sign is being used backwards, like:
5 = Variable;
An l-value is a general name for anything that can appear on the left-hand side of an equal sign, that is, it can be assigned a value: a simple variable, an array reference, a pointer reference.
*s + 1 = whatever;
s++" is an expression
You can assign to s or *s, but not *s + 1.
Hope this helps,
Sorry, but you are not allowed to view signatures , please Register or Login