I am getting a segmentation error and the core gets dumped when the for loop is run. I know it's because I have a dangling variable (letterInputting) but does anyone have an idea on how to make a for loop or maybe a while statement where this code can work?
int wordToGuessLength = hangmanWords [hangmanShuffler].length();
...
string lettersToGuess [wordToGuessLength];
This is a Variable Length Array which the C++ standard doesn't support.
2. The following is accessing that VLA out of bounds.
1 2 3
int letterInputting;
for ( letterInputting; letterInputting <= wordToGuessLength; letterInputting++ )
A. You use letterInputting before it is assigned a value.
B. When you use the operator<= you will access the VLA one past the end. Remember arrays start at zero and end at size - 1.