<br />
<b>Warning</b>:  Undefined array key "global_protection_id" in <b>/home/wikitechy/public_html/interview-questions/wp-content/plugins/content-protector/inc/class-ps-rest-handler.php</b> on line <b>51</b><br />
{"id":309,"date":"2021-07-12T19:45:16","date_gmt":"2021-07-12T19:45:16","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=309"},"modified":"2021-09-14T06:23:08","modified_gmt":"2021-09-14T06:23:08","slug":"pick-out-the-odd-one-out-of-the-following-malloc-calloc-free-realloc","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/c\/pick-out-the-odd-one-out-of-the-following-malloc-calloc-free-realloc\/","title":{"rendered":"Pick out the odd one out of the following malloc(), calloc(), free(), realloc() ?"},"content":{"rendered":"<div class=\"TextHeading\">\n<div class=\"hddn\">\n<h2 id=\"pick-out-the-odd-one-out-of-the-following-malloc-calloc-free-realloc\" class=\"color-pink\" style=\"text-align: justify;\">Pick out the odd one out of the following malloc(), calloc(), free(), realloc() ?<\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>free()<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"subheading\" style=\"text-align: justify;\">\n<h2 id=\"explanation\">Explanation:<\/h2>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>Here malloc(), calloc(), realloc() are the memory allocation function. whereas free() is used to free the memory which is allocated by the above function.<\/li>\n<li>so the free() is odd term.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"TextHeading\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<h2 id=\"malloc\" class=\"color-green\">malloc()<\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>The function malloc() reserves a block of memory of specified size and return a pointer of type void which can be casted into pointer of any form.<\/li>\n<li>It allocates single block of memory<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"text-center row\" style=\"text-align: justify;\"><\/div>\n<div class=\"TextHeading\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<h2 id=\"calloc\" class=\"color-green\">calloc()<\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>calloc() allocates multiple blocks of memory each of same size and sets all bytes to zero.<\/li>\n<li>It allocates space for an array elements, initializes to zero and then returns a pointer to memory.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"TextHeading\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<h2 id=\"realloc\" class=\"color-green\">realloc()<\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>If suppose we assigned more or less memory than required, then we can change the size of the previously assigned memory space using realloc.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"TextHeading\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<h2 id=\"free\" class=\"color-green\">free()<\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\">\n<div class=\"hddn\">\n<ul>\n<li style=\"text-align: justify;\">The function free is used to deallocate or free the memory after the program finishes which was dynamically allocated in the program.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Answer : free()..<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"passster_activate_protection":false,"passster_protect_child_pages":"","passster_protection_type":"password","passster_password":"","passster_activate_overwrite_defaults":"","passster_headline":"","passster_instruction":"","passster_placeholder":"","passster_button":"","passster_id":"","passster_activate_misc_settings":"","passster_redirect_url":"","passster_hide":"no","passster_area_shortcode":"","gtb_hide_title":false,"gtb_wrap_title":false,"gtb_class_title":"","gtb_remove_headerfooter":false,"footnotes":""},"categories":[1716],"tags":[1739,491,1740,211,1725,1728,1717,1726,1737,1733,203,199,214,198,363,209,205,1745,1738,1723,1720,1730,1719,1721,1722,1743,1735,222,1734,1727,1747,196,212,1731,1718,1724,710,207,366,204,217,288,1744,1729,1736,483,206,1741,1742,1746,15831],"class_list":["post-309","post","type-post","status-publish","format-standard","hentry","category-c","tag-accentur-interview-questions-and-answers","tag-applied-materials-interview-questions-and-answers","tag-asian-paints-ltd-interview-questions-and-answers","tag-bosch-india-software-interview-questions-and-answers","tag-c-memory-allocation-using-malloc","tag-c-programming-language-functions-malloc","tag-calloc-and-malloc-in-c","tag-calloc","tag-calloc-versus-malloc","tag-calloc-versus-mallocdifference-between-malloc","tag-capgemini-interview-questions-and-answers","tag-casting-networks-india-pvt-limited-interview-questions-and-answers","tag-cgi-group-inc-interview-questions-and-answers","tag-chetu-interview-questions-and-answers","tag-ciena-corporation-interview-questions-and-answers","tag-collabera-technologies-interview-questions-and-answers","tag-dell-international-services-india-pvt-ltd-interview-questions-and-answers","tag-dhfl-pramerica-life-insurance-company-ltd-interview-questions-and-answers","tag-difference-between-malloc","tag-difference-between-malloc-and-calloc-in-c","tag-dynamic-memory-allocation-in-c","tag-dynamic-memory-allocation-in-c-learn-to-use-calloc","tag-dynamic-memory-allocation-in-c-example","tag-dynamic-memory-allocation-in-c-programming-examples","tag-dynamic-memory-allocation-in-data-structure","tag-elico-healthcare-services-ltd-interview-questions-and-answers","tag-explain-malloc","tag-flipkart-interview-questions-and-answers","tag-free-and-realloc-functions","tag-free-realloc","tag-hcl-technol-interview-questions-and-answers","tag-ibm-interview-questions-and-answers","tag-indecomm-global-services-interview-questions-and-answers","tag-malloc","tag-malloc-calloc-realloc","tag-malloc-vs-calloc-vs-realloc","tag-mavenir-interview-questions-and-answers","tag-mphasis-interview-questions-and-answers","tag-netapp-interview-questions-and-answers","tag-oracle-corporation-interview-questions-and-answers","tag-peoplestrong-interview-questions-and-answers","tag-r-systems-interview-questions-and-answers","tag-raqmiyat-information-technologies-pvt-ltd-interview-questions-and-answers","tag-realloc","tag-realloc-and-free-in-c-languagec-dynamic-memory-allocation","tag-reliance-industries-ltd-interview-questions-and-answers","tag-sap-labs-india-pvt-ltd-interview-questions-and-answers","tag-tata-aia-life-insurance-interview-questions-and-answers","tag-tech-mahindr-interview-questions-and-answers","tag-the-linde-group-interview-questions-and-answers","tag-zenq-interview-questions-and-answers"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Pick out the odd one out of the following malloc(), calloc(), free(), realloc()<\/title>\n<meta name=\"description\" content=\"Pick out the odd one out of the following malloc(), calloc(), free(), realloc() ? - free() is used to free the memory which is allocated by the above function\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wikitechy.com\/interview-questions\/c\/pick-out-the-odd-one-out-of-the-following-malloc-calloc-free-realloc\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Pick out the odd one out of the following malloc(), calloc(), free(), realloc()\" \/>\n<meta property=\"og:description\" content=\"Pick out the odd one out of the following malloc(), calloc(), free(), realloc() ? - free() is used to free the memory which is allocated by the above function\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/c\/pick-out-the-odd-one-out-of-the-following-malloc-calloc-free-realloc\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-12T19:45:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-14T06:23:08+00:00\" \/>\n<meta name=\"author\" content=\"Editor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Editor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/c\/pick-out-the-odd-one-out-of-the-following-malloc-calloc-free-realloc\/\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/c\/pick-out-the-odd-one-out-of-the-following-malloc-calloc-free-realloc\/\",\"name\":\"Pick out the odd one out of the following malloc(), calloc(), free(), realloc()\",\"isPartOf\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#website\"},\"datePublished\":\"2021-07-12T19:45:16+00:00\",\"dateModified\":\"2021-09-14T06:23:08+00:00\",\"author\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757\"},\"description\":\"Pick out the odd one out of the following malloc(), calloc(), free(), realloc() ? - free() is used to free the memory which is allocated by the above function\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wikitechy.com\/interview-questions\/c\/pick-out-the-odd-one-out-of-the-following-malloc-calloc-free-realloc\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#website\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/\",\"name\":\"Wikitechy\",\"description\":\"Interview Questions\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757\",\"name\":\"Editor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"caption\":\"Editor\"},\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/author\/editor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Pick out the odd one out of the following malloc(), calloc(), free(), realloc()","description":"Pick out the odd one out of the following malloc(), calloc(), free(), realloc() ? - free() is used to free the memory which is allocated by the above function","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wikitechy.com\/interview-questions\/c\/pick-out-the-odd-one-out-of-the-following-malloc-calloc-free-realloc\/","og_locale":"en_US","og_type":"article","og_title":"Pick out the odd one out of the following malloc(), calloc(), free(), realloc()","og_description":"Pick out the odd one out of the following malloc(), calloc(), free(), realloc() ? - free() is used to free the memory which is allocated by the above function","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/c\/pick-out-the-odd-one-out-of-the-following-malloc-calloc-free-realloc\/","og_site_name":"Wikitechy","article_published_time":"2021-07-12T19:45:16+00:00","article_modified_time":"2021-09-14T06:23:08+00:00","author":"Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Editor","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wikitechy.com\/interview-questions\/c\/pick-out-the-odd-one-out-of-the-following-malloc-calloc-free-realloc\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/c\/pick-out-the-odd-one-out-of-the-following-malloc-calloc-free-realloc\/","name":"Pick out the odd one out of the following malloc(), calloc(), free(), realloc()","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"datePublished":"2021-07-12T19:45:16+00:00","dateModified":"2021-09-14T06:23:08+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"description":"Pick out the odd one out of the following malloc(), calloc(), free(), realloc() ? - free() is used to free the memory which is allocated by the above function","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/c\/pick-out-the-odd-one-out-of-the-following-malloc-calloc-free-realloc\/"]}]},{"@type":"WebSite","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website","url":"https:\/\/www.wikitechy.com\/interview-questions\/","name":"Wikitechy","description":"Interview Questions","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757","name":"Editor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","caption":"Editor"},"url":"https:\/\/www.wikitechy.com\/interview-questions\/author\/editor\/"}]}},"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/309","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/comments?post=309"}],"version-history":[{"count":3,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/309\/revisions"}],"predecessor-version":[{"id":3661,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/309\/revisions\/3661"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}