diff --git a/CM2005 Object Oriented Programming/Topic 3/3.3.1/a.exe b/CM2005 Object Oriented Programming/Topic 3/3.3.1/a.exe new file mode 100644 index 0000000..84e8df2 Binary files /dev/null and b/CM2005 Object Oriented Programming/Topic 3/3.3.1/a.exe differ diff --git a/CM2005 Object Oriented Programming/Topic 3/3.3.1/test.cpp b/CM2005 Object Oriented Programming/Topic 3/3.3.1/test.cpp new file mode 100644 index 0000000..4cefafb --- /dev/null +++ b/CM2005 Object Oriented Programming/Topic 3/3.3.1/test.cpp @@ -0,0 +1,19 @@ +#include +#include + +int main() +{ + double d{}; //initializes to 0, dicated by the compiler + std::string s = "x1.6x"; + try + { + d = std::stod(s); + } + catch(const std::exception& e) + { + //throw e; + std::cerr << e.what() << '\n'; + } + std::cout << "d: " << d << std::endl; + return 0; +} \ No newline at end of file