T
thomas
I have a list of strings composed of only 0 and 1, like
0000100001 1000010000, ....
They all have the same length.
Now they are stored in a vector of strings.
I want to calculate count(string1 xor string2).
for example:
1010, 0101 -xor-> 1111 --> 4 (four 1s in the result string)
1111, 0000 -xor-> 0000 --> 0
I can do it by string comparing, but I think it's really ugly.
And I do think there must be some easy and simple method, but I don't
know how.
Can you help me?
0000100001 1000010000, ....
They all have the same length.
Now they are stored in a vector of strings.
I want to calculate count(string1 xor string2).
for example:
1010, 0101 -xor-> 1111 --> 4 (four 1s in the result string)
1111, 0000 -xor-> 0000 --> 0
I can do it by string comparing, but I think it's really ugly.
And I do think there must be some easy and simple method, but I don't
know how.
Can you help me?