-
simple Array question.
Is there a way to have the user type something into an array and then find out and display how many characters the user input into the array (i guess this would be the size of the array)?
- I am just starting out in c++ so any suggestions are appreciated.
-
-
Ok, but how do I count how many letters the user input?
-
Show us what you've got. (I'd use strlen, though.)
-
I am still figuring out how to start the code. This is for a c++ class and we didn't learn some of the functions listed on that faq, so I think we should work mainly with arrays.
Does anyone have a simple way of doing this/suggestions?
-
Oops. I always default to C.
http://faq.cprogramming.com/cgi-bin/...&id=1043284385
And if you're having this much trouble posting a simple copy of that code with an attempt to work on this yourself, I'd guess you have to use something like a for loop to iterate through the string in search of the null character.
Take a stab at it.
-
I used that format and it works. But, is it possible to have exactly that but with an array with a maximum number of characters instead of a string? How would I do that?