{"id":898,"date":"2019-01-21T12:14:04","date_gmt":"2019-01-21T12:14:04","guid":{"rendered":"https:\/\/ibex.tech\/c\/?p=898"},"modified":"2022-02-17T10:13:11","modified_gmt":"2022-02-17T10:13:11","slug":"defining-functions","status":"publish","type":"post","link":"https:\/\/ibex.tech\/c\/c\/functions\/defining-functions","title":{"rendered":"Defining Functions"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Function with a default value<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/The function:\nbool my_function(uint32_t timeout)\n{\n  \/\/...\n}\n\n\/\/The function definition, with the default value:\nbool my_function(uint32_t timeout = 500);\nextern bool my_function(uint32_t timeout = 500);\n\n\/\/Calling it - both of these will work:\n  my_function();\n  my_function(1000);<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">With multiple variables<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/The function:\nbool my_function(uint32_t some_value, uint32_t timeout)\n{\n  \/\/...\n}\n\n\/\/The function definition, with the default value:\nbool my_function(uint32_t some_value, uint32_t timeout = 500);\nextern bool my_function(uint32_t some_value, uint32_t timeout = 500);\n\n\/\/Calling it - both of these will work:\n  my_function(2, );\n  my_function(2, 1000)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Function with a default value With multiple variables<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[77],"tags":[],"class_list":["post-898","post","type-post","status-publish","format-standard","hentry","category-functions"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/posts\/898","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/comments?post=898"}],"version-history":[{"count":2,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/posts\/898\/revisions"}],"predecessor-version":[{"id":901,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/posts\/898\/revisions\/901"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/media?parent=898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/categories?post=898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/tags?post=898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}