<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":4954,"date":"2022-10-07T06:03:47","date_gmt":"2022-10-07T06:03:47","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=4954"},"modified":"2022-10-07T06:03:47","modified_gmt":"2022-10-07T06:03:47","slug":"what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program\/","title":{"rendered":"What is a header file in C ? What will happen if we include a header file twice in a C program ?"},"content":{"rendered":"<ul>\n<li>Header files store the definitions and rules for different built-in functions in the C program.<\/li>\n<li>For example, printf(), scanf() functions are defined in stdio.h header file.<\/li>\n<li>A header file is a file with extention .h which contains C function declarations and macro definitions to be shared between several source files.<\/li>\n<li>There are two types of header file-files that a programmer writes and a file that comes with your compiler.<\/li>\n<li>Every header file contains a set of predefined functions, which makes c programming simpler.<\/li>\n<li>We should include the header file at the start of the program to be able to use the functions defined in the program.<\/li>\n<li>When header files are added twice in a program, the compiler will process its contents twice.<\/li>\n<li>This may cause an error when the compiler sees the same structure definition twice<strong>.<\/strong><\/li>\n<\/ul>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-full wp-image-4955\" src=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/what-is-header-file-in-c.jpg\" alt=\"\" width=\"845\" height=\"469\" srcset=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/what-is-header-file-in-c.jpg 845w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/what-is-header-file-in-c-300x167.jpg 300w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/what-is-header-file-in-c-768x426.jpg 768w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/what-is-header-file-in-c-390x216.jpg 390w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/what-is-header-file-in-c-820x455.jpg 820w\" sizes=\"(max-width: 845px) 100vw, 845px\" \/><\/p>\n<p><strong>\u00a0<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Header files store the definitions and rules for different built-in functions in the C program. For example, printf(), scanf() functions are defined in stdio.h header file. A header file is a file with extention .h which contains C function declarations and macro definitions to be shared between several source files. There are two types of [&hellip;]<\/p>\n","protected":false},"author":1,"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":[18850,18847,18844,18845,18842,18841,18843,18849,18852,18848,18840,18851,18846],"class_list":["post-4954","post","type-post","status-publish","format-standard","hentry","category-c","tag-c-including-header-files-multiple-times","tag-header-files-in-c","tag-header-files-in-c-c-and-its-uses","tag-header-files-in-c-c-with-examples","tag-if-we-include-the-same-header-file-twice","tag-in-c-language","tag-including-a-header-file-twice-in-c","tag-list-of-header-files-in-c-its-function","tag-use-of-header-file-in-c","tag-what-are-header-files-in-c","tag-what-happens-if-we-include-header-file-for-two-times-in-a-c","tag-what-is-header-file-in-c","tag-what-will-happen-if-we-include-a-header-file-twice"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What is a header file in C ? - Including a header file twice in c<\/title>\n<meta name=\"description\" content=\"What is a header file in C ? - Including a header file twice in c - Header files store the definitions and rules for different built-in functions in the C program.\" \/>\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\/what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is a header file in C ? - Including a header file twice in c\" \/>\n<meta property=\"og:description\" content=\"What is a header file in C ? - Including a header file twice in c - Header files store the definitions and rules for different built-in functions in the C program.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-07T06:03:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/what-is-header-file-in-c.jpg\" \/>\n<meta name=\"author\" content=\"webmaster\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"webmaster\" \/>\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\/what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program\/\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program\/\",\"name\":\"What is a header file in C ? - Including a header file twice in c\",\"isPartOf\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/what-is-header-file-in-c.jpg\",\"datePublished\":\"2022-10-07T06:03:47+00:00\",\"dateModified\":\"2022-10-07T06:03:47+00:00\",\"author\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4\"},\"description\":\"What is a header file in C ? - Including a header file twice in c - Header files store the definitions and rules for different built-in functions in the C program.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program\/#primaryimage\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/what-is-header-file-in-c.jpg\",\"contentUrl\":\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/what-is-header-file-in-c.jpg\",\"width\":845,\"height\":469},{\"@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\/f785ba3ecc599133e65ab6138042a3e4\",\"name\":\"webmaster\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g\",\"caption\":\"webmaster\"},\"sameAs\":[\"https:\/\/www.wikitechy.com\/interview-questions\"],\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/author\/webmaster\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is a header file in C ? - Including a header file twice in c","description":"What is a header file in C ? - Including a header file twice in c - Header files store the definitions and rules for different built-in functions in the C program.","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\/what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program\/","og_locale":"en_US","og_type":"article","og_title":"What is a header file in C ? - Including a header file twice in c","og_description":"What is a header file in C ? - Including a header file twice in c - Header files store the definitions and rules for different built-in functions in the C program.","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program\/","og_site_name":"Wikitechy","article_published_time":"2022-10-07T06:03:47+00:00","og_image":[{"url":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/what-is-header-file-in-c.jpg"}],"author":"webmaster","twitter_card":"summary_large_image","twitter_misc":{"Written by":"webmaster","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program\/","name":"What is a header file in C ? - Including a header file twice in c","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program\/#primaryimage"},"image":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program\/#primaryimage"},"thumbnailUrl":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/what-is-header-file-in-c.jpg","datePublished":"2022-10-07T06:03:47+00:00","dateModified":"2022-10-07T06:03:47+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4"},"description":"What is a header file in C ? - Including a header file twice in c - Header files store the definitions and rules for different built-in functions in the C program.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program\/#primaryimage","url":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/what-is-header-file-in-c.jpg","contentUrl":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/what-is-header-file-in-c.jpg","width":845,"height":469},{"@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\/f785ba3ecc599133e65ab6138042a3e4","name":"webmaster","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g","caption":"webmaster"},"sameAs":["https:\/\/www.wikitechy.com\/interview-questions"],"url":"https:\/\/www.wikitechy.com\/interview-questions\/author\/webmaster\/"}]}},"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4954","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/comments?post=4954"}],"version-history":[{"count":1,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4954\/revisions"}],"predecessor-version":[{"id":4956,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4954\/revisions\/4956"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=4954"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=4954"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=4954"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}