I think it might be a problem with my compiler. I dosn't like running this code on G++, and I want to see if I've done something wrong. The error I'm getting is:
Line 7: 'code' was not declared in this scope
Line 8: expected '.' or ';' before '{' token.
Line 17: expected primary-expression before '.' token
Line 22: 'decode' cannot be used as a function.
I'm only a bare-bones beginner, so if there are a lot of errors in my code please point them out to me.