I'm getting a compile error with this bit:
int valid(const char str[]){
int i, total = 0, multiplier = 10;
for(i=0; i < 11; i++){
str[i] * multiplier += total; //this line is an invalid lvalue
multiplier--;
}
if(total % 11 != 0)
return 0;
else
return 1;
I send a string of numbers to this function, then I want to multiply each value in the string and add the product to a running total.