I'm trying to make the letters that are in the word stay there after each iteration of the loop. This code just temporarily shows the letter in the word and then only shows the next letter you guess. Any ideas on how I can get them to stay or do I need to approach this entirely different?

Right now, your program is structured so that every time the user guesses, the output is generated based on the secret string and the single character that the user most recently entered. This provides no way of saving the letters the user has guessed previously. To fix this, you can add a new array, guessedChars[], that keeps track of this information. Here's how I would edit your program: