



{"id":4489,"date":"2018-08-26T23:16:39","date_gmt":"2018-08-26T17:46:39","guid":{"rendered":"http:\/\/computersirkiclass.com\/?p=4489"},"modified":"2026-03-18T18:51:56","modified_gmt":"2026-03-18T13:21:56","slug":"what-is-function-overloading","status":"publish","type":"post","link":"https:\/\/computersirkiclass.com\/cskc\/what-is-function-overloading\/","title":{"rendered":"What is function overloading?"},"content":{"rendered":"<div id=\"modal-ready\"><p>Function overloading is a key technique to implement polymorphism in c++ where we are allowed to declare more than one function of same name provided their signatures are different.<\/p>\n<p>&nbsp;<\/p>\n<p>Difference in signature means that the input parameters are different in terms of their type, count or order. For e.g.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>int func(int);<\/strong> is different from <strong>int func(char);<\/strong><br \/>\ndifference is just the data type of input<\/p>\n<p>&nbsp;<\/p>\n<p><strong>int func(int);<\/strong> is different from <strong>int func(int,int);<\/strong><br \/>\ndifference is just the number of inputs<\/p>\n<p>&nbsp;<\/p>\n<p><strong>int func(int,char);<\/strong> is different from <strong>int func(char,int);<\/strong><br \/>\ndifference is just the order of input<\/p>\n<p>&nbsp;<\/p>\n<p><strong>int func(int,int);<\/strong> is different from <strong>int func(int,int,char);<\/strong><br \/>\ndifference is based on type and count both.<\/p>\n<p>&nbsp;<\/p>\n<p>If the difference is based on return type only then it is not considered as overloading. for e.g.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>int func(int);<\/strong> and <strong>void func(int);<\/strong><br \/>\nare not polymorphic or overloaded is difference is just on the return data type.<\/p>\n<p>&nbsp;<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Understanding in which situations, a function is considered to be overloaded.<\/p>\n","protected":false},"author":1,"featured_media":7771,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[114,99,98],"tags":[240],"model_paper":[],"class_list":["post-4489","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cnr","category-cpp","category-cpp-all","tag-cp390-function-overloading-concepts","cpp_index-cpb010-function-overloading-concepts"],"acf":[],"_links":{"self":[{"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/posts\/4489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/comments?post=4489"}],"version-history":[{"count":2,"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/posts\/4489\/revisions"}],"predecessor-version":[{"id":4492,"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/posts\/4489\/revisions\/4492"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/media\/7771"}],"wp:attachment":[{"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/media?parent=4489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/categories?post=4489"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/tags?post=4489"},{"taxonomy":"model_paper","embeddable":true,"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/model_paper?post=4489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}