{"id":659,"date":"2015-10-19T19:04:58","date_gmt":"2015-10-19T19:04:58","guid":{"rendered":"http:\/\/coolt.ch\/notizen\/?p=659"},"modified":"2015-10-19T19:05:28","modified_gmt":"2015-10-19T19:05:28","slug":"own-error-class-basics","status":"publish","type":"post","link":"https:\/\/coolt.ch\/notizen\/own-error-class-basics\/","title":{"rendered":"own Error-Class (Basics)"},"content":{"rendered":"<pre class=\"lang:sh decode:true\"><strong>class neg_sum{};<\/strong>\r\n\r\nint main(){\r\n  <strong>try {<\/strong>\r\n.     ...\r\n.     \r\n.     ...\r\n  <strong>} catch(neg_sum const &amp; e){<\/strong>\r\n.     std::cout &lt;&lt; \"negative value\"&lt;&lt;\"\\n\";\r\n  <strong>}   \r\n}<\/strong><\/pre>\n<p><strong>In der Funktion<\/strong><\/p>\n<pre class=\"lang:sh decode:true\">double solve_quadratic(int a, int b, int c) {\r\n    double delta = pow(b, 2) - (4 * a * c);\r\n    <strong>if (delta &lt; 0) {\r\n        throw Negative_delta{};\r\n    }<\/strong>\r\n.   .....\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>class neg_sum{}; int main(){ try { . &#8230; . . &#8230; } catch(neg_sum const &amp; e){ . std::cout &lt;&lt; &#8222;negative value&#8220;&lt;&lt;&#8222;\\n&#8220;; } } In der Funktion double solve_quadratic(int a, int b, int c) { double delta = pow(b, 2) &#8211; (4 * a * c); if (delta &lt; 0) { throw Negative_delta{}; } . &#8230;.. &hellip; <a href=\"https:\/\/coolt.ch\/notizen\/own-error-class-basics\/\" class=\"more-link\"><span class=\"screen-reader-text\">own Error-Class (Basics)<\/span> weiterlesen<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[29],"tags":[],"_links":{"self":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/659"}],"collection":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/comments?post=659"}],"version-history":[{"count":3,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/659\/revisions"}],"predecessor-version":[{"id":662,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/659\/revisions\/662"}],"wp:attachment":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/media?parent=659"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/categories?post=659"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/tags?post=659"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}