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 8556241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:18:08+00:00 2026-06-11T15:18:08+00:00

This question is to understand the standard behavior for header file inclusion (not the

  • 0

This question is to understand the standard behavior for header file inclusion (not the one implemented on my compiler).

I have two header files with same names (but contents are different):

1) /user/include/myheader.h  # In standard system folder
2) /private/myheader.h       # In my private folder

Assume both the headers contains same multiple inclusion prevension macros

#ifndef MYHEADER
#define MYHEADER
...
#endif

I have C file /private/test.c, which includes both the above headers:

#include <myheader.h>  // Includes from standard system folder
#include "myheader.h"  // Includes from the folder where test.c is present

Do the content from both files go into the C file while pre-processing, since each MYHEADER definition has separate name space ? Or the second inclusion will be prevented since MYHEADER is already defined in same namespace ?

  • 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-06-11T15:18:09+00:00Added an answer on June 11, 2026 at 3:18 pm

    N1570:

    6.10.3 Macro replacement

    …
    7 The identifier immediately following the define is called the macro name. There is one
    name space for macro names.
    Any white-space characters preceding or following the
    replacement list of preprocessing tokens are not considered part of the replacement list for either form of macro.

    Emphasis mine.

    As written, only the contents of the first myheader.h file will be processed.

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

Sidebar

Related Questions

I have this classic question of how should the C++ Standard (I mean the
Based on this question I understand the purpose of the construct in linking C
I read the answers to this question and understand what the code var qq
This question has been asked before but i still don't understand it fully so
I understand that this question may be subjective, this is why I need an
I understand that this question could be answered with a simple sentence and that
This question bugs me. How event handling systems works? what i understand is that
I know this question is difficult to understand but I need a mathematical equation
I know this question was already posted in StackOverflow but I either didnt understand
I came up with this question because I don't understand how address translation is

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.