+ 1
Is this Bitwise XOR?
does anyone know how to explain what the below code does? Particularly the str[i]^=32; if (str[i]>='a' && str[i]<='z'){ str[i]^=32; }
2 ответов
+ 6
It is the same as:
str[i] = str[i] ^ 32;
This gets the current value held in str[i] and performs a bitwise XOR by 32 and then sets the resulting value back in str[i].
https://www.cprogramming.com/tutorial/bitwise_operators.html