Hi, I have a question concerning chaining functions. Here is my code below:
using namespace std;
string word, secret;
cout << "Enter a word" << endl;
cin >> word;
string str (word);
cout << "String Length: " << str.length() << endl;
string hidden_word(string secret)
return string(secret.length(), '-');
Now when I run the program, it would ask me to enter a word, then it would output the number of strings the word has.
So for example, the word trees have five letters so the answer is five.
Now how would we hook that to the function below called string hidden_word(string secret)?
I want the program to also output the number of dashes in place of the number of letters.
How would we hook the function string hidden_word to main? Or should it get hooked to the function enter_secret?