invalid types 'char [int]' for array subscript

You declared caracter as a single char, but are trying to index it like it's an array.