I’m trying to do some calculation program using C what am I getting error is
error: lvalue required as left operand of assignment
This error cause from define a value on the header and then I assign using = in the main body.
If I put that value which it is in the header instead put them in the int or double then it will be fine, but I don’t want them to be there.
please tell me if needed more information about what I’m trying to say.
Thanks
here is what I put on the define #define price 50
and in the body where I’m getting error price = price * 2 + total
You can’t assign to a define! After the preprocessor is done, to the compiler the code looks like this: