Im accepting a float from the user. I want to protect from him inputing a char cos it messes everything up. How do i do this?
sroberts82 0 Newbie Poster
Recommended Answers
Jump to Postdo u mean numercal value ?only not charcters ??
Jump to Postsorry, I mean in C.
Check out the strtol example here. It can be easily adapted to floating point instead of integer input by instead using strtod.
All 6 Replies
meabed 37 Junior Poster Team Colleague
meabed 37 Junior Poster Team Colleague
sroberts82 0 Newbie Poster
meabed 37 Junior Poster Team Colleague
sroberts82 0 Newbie Poster
Dave Sinkula 2,398 long time no c Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.