Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 525539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:40:56+00:00 2026-05-13T08:40:56+00:00

If I have a several header files :lets say 1.h , 2.h , 3.h

  • 0

If I have a several header files :lets say 1.h, 2.h, 3.h.
Let’s say the all three of the header files have #include <stdlib.h> and one of the include files in them.
When I have to use all 3 header files in a C file main.c,
it will have 3 copies of #include <stdlib.h> after the preprocessor.
How does the compiler handle this kind of conflict?
Is this an error or does this create any overhead?

If there are no header guards, what will happen?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:40:57+00:00Added an answer on May 13, 2026 at 8:40 am

    Another point: You can redeclare a function (or extern variable) a bazillion times and the compiler will accept it:

    int printf(const char*, ...);
    int printf(const char*, ...);
    

    is perfectly legal and has a small compilation overhead but no runtime overhead.

    That’s what happens when an unguarded include file is included more than once.

    Note that it is not true for everything in an include file. You can’t redeclare an enum, for example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a common HTML header file which I use in several PHP files.
I'm working in a project with several classes. All header files are into include
I have a text file with several different sections. Each section has a header
Is it possible to include C/C++ header files in a qmake (.pro) file? I
Say you have a css files loader style.php : <?php header('Content-type: text/css'); foreach(array('style1.css', 'style2.css',
Several lines of code are worth a thousand words: I have three simple files:
Several lines of code are worth a thousand words: I have three simple files:
I have an objective-c/xcode project with several header and implementation files. I'd like to
I have several files (header.html, nav.html, footer.html). I was wondering if there's a way
I have several excel files carrying 90 columns and about 500 rows, each file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.