[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CppStrIsDouble
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CppStrIsDouble
(C++) Check if a std::string can be converted to a double
///Checks whether a std::string can be converted to a double. ///Returns true if possible, also returning this integer by referencing. ///Returns false otherwise, setting the referenced double to zero. bool isDouble(const std::string& s, double& rDouble) { std::istringstream i(s); if (!(i >> rDouble)) { rDouble = 0; return false; } return true; }
- include <sstream>
(C++ Builder) Check if a String can be converted to a double
Other code snippets
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
