Possible Duplicate:
What are extern variables in C?
What is the difference between extern storage class and global variables in C programming language.? To me it seems like they both are same thing .Please clarify.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
an
externvariable is a declaration of a variable which is defined in another unit.You declare it in
.hfile:and if you want to use it in
.cfile you define it in the global scope. And you shouldincludethe.hfile in the source file that uses it.Global variables are ariables which were declared outside of a block.
They can be accessed everywhere in the program.
Please note that it is very important to know the difference between Declaring a variable and Defining it: