Update 2024-03-27: Greatly expanded the "Samples" page and renamed it to "Glossary".
Update 2024-04-04: Added 5 million mid-2011 posts from the k47 post dump. Browse (mostly) them here.
Update 2024-04-07: Added ~400 October 2003 posts from 4chan.net. Browse them here.

Welcome to Oldfriend Archive, the official 4chan archive of the NSA. Hosting ~170M text-only 2003-2014 4chan posts (mostly 2006-2008).
[46 / 5 / ?]

C++

No.17269168 View ViewReplyOriginalReport
Hi /g/.

I'm working on a C++ project. What I need to do is check if the input is a valid float number in a function.

Now making it into a function is easy, so my problem is just understanding how to bugcheck something that may contain a decimal and a minus sign.

The function should also return the value inputted if it was correct. For example, I got the framework for the function below in the pastebin link.

http://pastebin.com/wagRZafL

Thank you very much any help you can give, Anon.