Ok, so show us a bit of code for that function at least. Can't help without seeing what you've done so far.
I'm not seeing how your output above relates to a hangman game... is it the number of letters in the word?
EDIT:
For your original question, if you know the longest line that you'll ever encounter, then a char array can be initialized as one char longer than that number. Otherwise you will need to look into dynamic memory (such as using the keyword 'new' to allocate memory on the heap and delete to release it).
While it's a good idea from a developer standpoint to know how to use new and delete properly, there are some C++ standard libraries that simplify matters considerably. The String library (<string> not <string.h>) is an example of a c++ object that can grow as needed, vector is used if you need something other than characters. There are many more container classes also designed to grow as needed, but those are the most commonly used.
There are a lot of examples out there with a quick google, so I won't go into detail, but I think you'll have the easiest time with the <string> library.