char c1 = 'A';
char c2 = 'F';
char final = (char) c1^c2;
This always return the result i am looking for, but it doesn't work if either c1 or c2 contain special characters. Any idea what i can change to allow special characters? Thanks
char c1 = 'A';
char c2 = 'F';
char final = (char) c1^c2;
This always return the result i am looking for, but it doesn't work if either c1 or c2 contain special characters. Any idea what i can change to allow special characters? Thanks
"Special Characters" could mean any number of things. If you're trying to represent Unicode code points (which are 32-bit) in char
s (which are 8-bit) you're going to encounter problems. Consider using unichar
instead.
You may also want to consider using NSString
s instead of managing individual characters yourself, since they take character set into account.