PLEASE ALWAYS USE CODE TAGS (the <> formatting button), to the right of this box, when posting code. Along with the proper indenting it makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/ http://www.cplusplus.com/articles/z13hAqkS/ Hint: You can edit your post, highlight your code and press the <> formatting button. You can use the preview button at the bottom to see how it looks. I found the second link to be the most help. |
|
|
vectorName.size()
or vectorName.length()
will tell you how many words that are in the vector which is how many elements, or words, you have processed. The ".size()" and ".length()" functions both return the same number which is how many elements are in the vector.I'm having trouble opening the file on my computer..even though I have it saved it says the system can't find the file. |
|
|
The number of words in the vector is: 10 The: 3 quick: 5 red: 3 fox: 3 jumped: 6 over: 4 the: 3 lazy: 4 brown: 5 dog: 3 The average number of letters is: 3.9 |
|
|
string filename = "C:\My Documents\words.txt";
string filename = "C:\\My Documents\\words.txt";
std::system("cd");
on windows and std::system("pwd");
on linux.