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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
“Special Characters” could mean any number of things. If you’re trying to represent Unicode code points (which are 32-bit) in
chars (which are 8-bit) you’re going to encounter problems. Consider usingunicharinstead.You may also want to consider using
NSStrings instead of managing individual characters yourself, since they take character set into account.