ambiguous overload for 'operator=' in 'r[i]=((int)key)+0x....)'

Just an update on the problem above,
It turns out that the line

r[i] = key-48;

should be

r[i] = String (key-48);

Thanks guys for your help!