always get ascii instead of numbers

As the title says i'm trying to get my code to tell me how many characters are in my string. It comes back and shows a symbol. Its always the same symbol for example I get a diamond or a spade or a smiley depending on what I write in the string. What am I missing so it actually returns a number value vs the symbols.

1
2
3
4
5
6
7
8
cout << "\n\nEnter the phrase you want to encode including spaces ";
			cin.ignore(80, '\n');
			getline(cin,phrase);
			
			
			phraselength = phrase.length();
			
			cout << "\n\nphrase length is " << phraselength;
What type of variable is phraselength? It should be a std::size_t.
Last edited on
Hey LB,

Thanks for your reply. I had phraselength as a string instead of int. It works now thanks!
Topic archived. No new replies allowed.