Ok, heres a little bit of code. The player enters a word, then I want to create a string (guessword) the same length, but have all of its elements set to '-'. It doesn't work. I get a bunch of weird characters:
Code:
char word[MAX_LEN]; //Players secret word
char guessword[MAX_LEN]; //Duplicate word
char input; //Input char
bool win = false; //Has the player won?
int wrong = 0;
cout<<"Enter the secret word to be guessed: "; //Display command
cin.getline(word, MAX_LEN); //Get secret word
int len = strlen(word);
for(int i = 0; i < len; i++) //Set array to all dashes
strcat(guessword, "-");