answersLogoWhite

0


Best Answer

The declaration 'int a' both declares the variable of 'a' and allocates memory for it.

When you use 'extern' you are referring to a variable called 'a' that has its memory allocated in another module. The actual variable 'a' is not in the same compilation unit as the current one being compiled. Where the variable 'a' is located is resolved by the linker.

When using 'extern' you state your intent to use a variable called 'a', but it doesn't reserve any memory for it in the current module.

User Avatar

Wiki User

βˆ™ 14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Difference between int a and extern int a. why the first one is definition while the second is declaration please explain?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Explain inventory Management policies?

what is definition of inventory? what is the difference between inventory and asset?


What is the difference between an example and a definition?

An example is where someone asks you what something is you show them instead of tell them. A definition is where you explain what something is.


How do you explain the difference between the vassals and serfs?

Explain the difference between the vassals and the serfs


Explain the difference between young and mature mountains?

Explain the difference between young and mature mountains?


What is difference between explain and describe?

Describe is what it is and explain is why it is as it is


What is the difference between describe and explain?

Describe is what it is and explain is why it is as it is


Explain the difference between a cash and credit transaction for purchass and sales?

explain the difference between cash and credit transaction


Explain the difference between share of customer and customer equity.?

Explain the difference between share of customer and customer equity


What is the difference between a system and a subsystem?

explain the difference between systems and sub systems


Explain the difference betwwen the two types of feeding?

explain the difference between the two types of feeding?


Explain the difference between the solubility behaviors of glycerol and triglycerides?

Explain the difference between the solubility behaviors of glycerol,fatty acid and triglycerides


Explain the difference between batch processing and real-time processing?

explain the difference between batch processing and real-time processing