char line, newline;
int length, i;
printf("Enter a word: ");
length = strlen(line);
for (i=0; i<length; i++)
newline[i] = line[i] ^ '20';
in this code, when i input 'a' i get a 'Q'. and when i input a 'Q' i get a 'a'. the purpose of my code is to change the case; capital to lower and vice versa.
what i did was use an array and individually change the 6th bit. but the result changes the 5th and 6th bit. i exclusive or'd the 6th bit using '20'.
can someone see what i'm doing wrong?