0

Hello i have a quick question working on a hangman project and have most of it done but i was wondering how to count how many letters a word has in order to have the right amount of spaces wondering if a function or something exists or a link to information about how to do it would be very appreciated.

thank you

3
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by acoxia
0

string.length()
perhaps?

Guessing you really are using C++ properly, and using std::string, and not say char arrays from C.

0

if your using the iostream library,

strlen(szString) + 1 //+1 for the null terminator

will work just dandy.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.