I get this error in C: expression must be a modifiable lvalue
void bfInsertion(BloomFilter* bloomFilter,const char* elem,int elemLen)
{
int i = 1;
while (i <= elem)
{
elem[i] = 1;
i += 1;
}
return elem;
}
I understood that the problem it's about the left side of elem[i] = 1;
but I couldn't understand how to do it correctly.
Elem is an array of byte and I want to put 1 on the i-th bit.
This is the pseudo-code:
1. i ←1;
2. while i ≤ k do
3. b[hi (delta)] ← 1;
4. i ← i + 1;
PS. I can only modify what's inside the function, not what i pass to it