Click here to Skip to main content
15,900,589 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Example: A string: 76y8y98
ERROR
A string: -67.112
-67.112

What I have tried:

i tried to read the string and use for loop to find character in string but i've tried a lot of ways to test if it's real number but nothing seem to work. i'm a beginner thanks.
Posted
Updated 22-Dec-17 6:25am
Comments
jeron1 22-Dec-17 12:25pm    
Update your question and post the code that you tried.
Richard MacCutchan 22-Dec-17 12:33pm    
You need to split the string at each y, and that gives you three integral numbers. How you got to -67.112 is a mystery.
Rick York 22-Dec-17 13:32pm    
If it is a real number it will have a decimal point, right?

1 solution

 
Share this answer
 
Comments
Rick York 22-Dec-17 13:30pm    
I don't think that is usable in a C program.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900