Code:
int main(void)
{
char line[26], newline[26];
int length, i;

	printf("Enter a word: ");
	scanf("%26s", &line);
	length = strlen(line);

	for (i=0; i<length; i++)
	{
		newline[i] = line[i] ^ '20';
		printf("%c", newline[i]);
	}
	printf("\n");
}
hi,

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'.

8421 8421
0010 0000

can someone see what i'm doing wrong?

thanks,
barneygumble742