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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:24:52+00:00 2026-05-15T11:24:52+00:00

I read from a book about tentative defination that, A tentative definition is any

  • 0

I read from a book about tentative defination that,

A tentative definition is any external data declaration that has no
storage class specifier and no initializer. A tentative definition
becomes a full definition if the end of the translation unit is
reached and no definition has appeared with an initializer for the
identifier

Please explain what the above statement means.
Also, the difference between Declaration and Definition? I got mixed up due to this. 🙁
And why doesn’t this program give an error:

#include <stdio.h>

int a;      //Tentative definition
int a;      //similarly this declaration too.
int main()  //not getting any error with this code why its so?
{
    printf("hi");
} 

Also, what is wrong with this code:

#include<stdio.h>
printf("Hi");
int main(void){
    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-15T11:24:52+00:00Added an answer on May 15, 2026 at 11:24 am

    A variable declaration says, “there is a variable with the following name and type in the program”.

    A variable definition says, “Dear Mr. Compiler, please allocate memory for a variable with the following name and type now.”

    So there can be multiple declarations for the same variable, but there should be only one definition.

    In C, pure declarations (that are not also definitions) are preceded with the keyword extern. So, since you do not have this keyword in your first example, what you have is two definitions. On its face, this would seem to be a problem (and is in fact an error in C++), but C has a special “tentative definition” rule which allows multiple definitions for the same variable in the same translation unit so long as they all match and at most one has an initializer. The C compiler, behind the scenes, combines all of the tentative definitions into a single definition.

    Had you attempted to initialize both definitions, like this:

    int a = 1;
    int a = 2;
    

    Then you would have had an error.

    Your second question is more straightforward. In C, you simply cannot have executable statements outside of the body of a function. It’s just not allowed. Think about it: when would you expect it to run if it were allowed?

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

Sidebar

Related Questions

I have to write a program that read from a file that contains the
I'm trying to open and read from a serial port using the System.IO.Ports.SerialPort class.
I'm trying to create a Zip file from .Net that can be read from
I have an XmlDocument that already exists and is read from a file. I
do you use Heroku to write Ruby on Rails app? i read about from
I'm new in c#. I have read some book about c# for beginners. Now
I need to read from a variety of different text files (I've some delimited
I'm writing a program to read from a POP3 mailbox and upload the email
I'm trying to create classes to read from my config file using ConfigurationSection and
I want to be able to read from an unsorted source text file (one

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.