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

  • Home
  • SEARCH
  • 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 6590607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:19:16+00:00 2026-05-25T17:19:16+00:00

Let us say I have only one file in my project called test.c; the

  • 0

Let us say I have only one file in my project called test.c; the code below does not compile if I do not define “TRUE”. I just want to understand the behavior. Please throw some light on this aspect.

#ifdef TRUE
static int a;
extern int a;
#else
extern int a;
static int a;
#endif

int main (void)
{
  a =10;
  printf("%d", a);
  return 0;
}
  • 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-25T17:19:17+00:00Added an answer on May 25, 2026 at 5:19 pm

    When TRUE is not defined, the first declaration (extern) says a has external linkage (ISO/IEC 9899:1999, 6.2.2, paragraph 4, no prior declaration). The second declaration (static) states a has internal linkage (paragraph 3). An identifier cannot have both internal and external linkage (paragraph 7).

    In the TRUE defined case, the extern in the second declaration has no impact because there is a prior declaration declaring a with internal linkage (paragraph 4).

    See draft of ISO/IEC 9899:1999.

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

Sidebar

Related Questions

If one of my processes open a file, let's say for reading only, does
Let's say that under my repository trunk I have one file (script.sh) and two
Say I have this file: cat > test.txt <<EOF line one word line two
Let's say you have a profile page that can only be accessed by the
Let's say I have a Type II SCD database, that is basically append only.
So let's say I have a matrix, mdat and I only know the index
Let say I have need to define the following function: Identity = chr.ord But
Let say I have abstract class called: Tenant and Customer. The tenant in this
let say i have function like below function doSomethingNow(){ callSomethingInFutureNotExistNow(); } at the moment
Let say i have some words AB, AAB, AA. AB is not a prefix

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.