robdb,
First, am I correct in assuming that your program is reading in the whitespace-separated words from one file, and writing out encoded versions of the words one-per-line?
If that's the case, first, you're sizing index_t array incorrectly. You don't want an index-entry per word in your file, you want an index-entry per character in your string. If you use vector<int> instead of a C-style int-array, the compiler (or the vector<> class, really) will take care of making sure it's as big as you need to store each encoded string as you encounter it. Otherwise, keep track of the currently-allocated size of index_t and whenever you get a string longer than that, reallocate it to be long enough for that string.
Other than that, what value do you store in index_k or index_t if the character isn't in your ALPH set?
Finally, since it doesn't look as though you access index_t outside of your for(i...) loop, you don't need to maintain an array of indices for the word anyway -- just compute the encoded letter and write it to your output file..
But I think maybe you're hacking away at the problem instead of thinking through each step, and what needs to happen as part of that step.
Since you've already written "read an input file into a list-of-strings" functionality, then write some kind of "write a list-of-strings to an output file" functionality, and test that if you just write out the same list …