{"id":9497,"date":"2025-07-16T22:48:48","date_gmt":"2025-07-16T22:48:48","guid":{"rendered":"https:\/\/olive-ostrich-890936.hostingersite.com\/?p=9497"},"modified":"2025-10-08T21:15:36","modified_gmt":"2025-10-08T21:15:36","slug":"parameters-vs-arguments-in-c-c","status":"publish","type":"post","link":"https:\/\/gloritech.com.br\/?p=9497","title":{"rendered":"Parameters vs Arguments in C\/C++"},"content":{"rendered":"<p>When the topic is Function, there are some misunderstandings about what concerns parameter and argument of a function. To create a function in C\/C++ , we need to define a return type(void, int, char, float, etc), a name and at least, one variable as the formal parameter.<\/p>\n<p>An exemple in C:<\/p>\n<p>#include&lt;stdio.h&gt;<\/p>\n<p>\/*Here, &#8220;power&#8221; is the name of function, in which represents a mathematical function for any given number (base) raised to some defined number(exponent). Or, any number multiplied by itself for an specific number of times(so called the exponent). *\/<\/p>\n<p>int power(int base, int n) \/* base and n are the formal parameters of the function named power*\/<\/p>\n<p>{int p=1;for(int i=1; i&lt;=n; ++i)<\/p>\n<p>p*=base;<\/p>\n<p>printf(&#8220;POWER FUNCTION:%d To The Power of %d is: %dn&#8221;, base,n,p);<\/p>\n<p>}<\/p>\n<p>int main() {\u00a0<\/p>\n<p>power(3,4); \/* in main function, we call the function power with two arguments: the int variables &#8216;base&#8217; and &#8216;n&#8217;, represented by the values of 3 and 4) *\/<\/p>\n<p>}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When the topic is Function, there are some misunderstandings about what concerns parameter and argument of a function. To create a function in C\/C++ , we need to define a return type(void, int, char, float, etc), a name and at least, one variable as the formal parameter. An exemple in C: #include&lt;stdio.h&gt; \/*Here, &#8220;power&#8221; is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"normal-width-container","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-9497","post","type-post","status-publish","format-standard","hentry","category-info-e-tech"],"_links":{"self":[{"href":"https:\/\/gloritech.com.br\/index.php?rest_route=\/wp\/v2\/posts\/9497","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gloritech.com.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gloritech.com.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gloritech.com.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gloritech.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9497"}],"version-history":[{"count":0,"href":"https:\/\/gloritech.com.br\/index.php?rest_route=\/wp\/v2\/posts\/9497\/revisions"}],"wp:attachment":[{"href":"https:\/\/gloritech.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9497"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gloritech.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9497"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gloritech.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9497"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}