I wrote my own class that stores a collection of transition probability matrices or transition count matrices, along with functions to read from and write to a file. I prefer my approach for two reasons. First, it hides irrelevant implementation details from code that has to access transition matrices. I can change my underlying representation of a collection pf transition matrices without having to rewrite any code that uses the array. Avoid the use of bare pointers whenever possible, by preferring the use of container classes and smart pointers.
Bare pointers are an invitation to memory leaks.
These classes manage their own memory, so I don't have to. Smart pointers also help. These are lightweight wrappers around a pointer that take care of freeing memory as needed. You'll also find that there is not a single new or delete in my code. My code includes a tokenizer class for turning a text file into a sequence of tokens.