In my class i've been having to use while() and if() statements to display different things from a given string.
Now i have to display the first occurrence of a number in this string. I know how to display all of the numbers and stuff in a string like:
How do i just display the first number in the string i haven't ever had to do it before. Any tips is greatly appreciated.Code:/*Finds the numbers in the string and displays them*/ while (o < len) { if(isdigit(str[o])) { printf("%c", str[o]); } o++; }
If it makes it easier, lets just say the string is: aevf4l68js5bb (the only reason the letters are so random is because the given string is way more confusing)



1Likes
LinkBack URL
About LinkBacks



