Write a c++ statement that print's "yes" if there is a digit in the variable sport3. I'm trying to find the correct string command to do this an easy way.
I was looking through the string references to try to find one of those. I found isgidit() but don't think that will work in this case. That's why I was wondering if there was something like isdigit() in the string reference that would let me be able to to that.
If you're wanting to use isdigit() then that's fine too. You'd just have to loop through each character of the string and pass each character into isdigit().
You could use some sort of boolean flag to highlight whether or not you've found a digit.
Well you were right about the [] so there's something new you learn. Got it working going off of Fransje's code so thanks for that. Instead of bool I just had it cout if there was a digit. Thanks for the help.