Mate, you should search on google writing "C++ STL Tutorial" .
Most things I have learned is from the codes of good coders from
Codeforces. You can find them from their contest's ranklist.
Here, the variable word is of type string, it can hold an string. Please search for C++ strings.
Best of luck mate :)