I think ^ has lower precedence than <<. Try cout << (string[0]^key[0]);
Ok, now it's outputting, thanks for that. So I got:
65
but is that correct? (using: cout << (string[0]^key[0]); on one line outside the for loop.
It's correct if it's after the for loop. (string gets changed in the for loop, remember?)