A large chunk of what is going wrong is you are using a single C string as if it were an array of C strings, accessing the individual elements of the char array trying to insert/extract more than one character.
A refresher on what C strings are:
https://www.learncpp.com/cpp-tutorial/c-style-strings/
That is why I went with std::vector and std::string, to read and hold the alphanumeric chunk of data on each line after the single character and the space. Plus, using a vector it is easy to retrieve the number of stored elements. Same for a C++ string. C strings, especially an array of C strings, requires a lot of manual tracking.
char vs. int, don't mix and match them.
https://www.learncpp.com/cpp-tutorial/chars/
Another biggie why things aren't working as you expect, you never actually call the functions.
https://www.learncpp.com/cpp-tutorial/introduction-to-functions/
Another thing to note, use more descriptive variable names, they self-document what the code is doing.
'n' really doesn't 'tell' us what is it used for. 'num_elems' (a guesstimation of use on my part) does document that it holds the number of used elements in some array.