I can see two arrays have been allocated but what is basically confusing me is string and char. What is the difference between them?
String (note the capitalization) is a class that allows for dynamically sizable strings. While you can use it with the Arduino, it's not recommended because it can cause fragmented memory. Normally, that isn't an issue on machines with plenty of RAM available, but not with the Arduino. The "char" you are seeing is a c-style string (Again, note the lack of capitalization) which is just an array of characters that is terminated by a null character.Stringstring
What is happening here
keyCode is being assigned to a substring (characters 0 to 10) of code.