Extern and Global are the storage space in C program.
Global provides us to access the variables from anywhere inside the program only whereas Extern provides us to access the variables from outside that program, i,e., some other program.
Global is a symbol declared at file scope, outside of any blocks. It is automatically visible to other modules unless it has the static attribute.
Extern, on the other hand, is the declaration of a symbol that is global in some other module, with the intent that the resolution will be made by the linker.
This answer is the C and C++ answer. I do not know C#, but I believe it similar. If anyone has better information about C#, please refine this answer.
AnswerGlobal variables and extern variables are very similar, but with a major difference. Let's say you have a global variable in your header file, like this:( Refer how u can add the variable declaration in the source code as extern, i think we cant add into header files as it said)int x = 0;Now, in each file that includes that header file, there will be a new variable called x. Modifying x in file1.cpp won't modify x in file2.cpp.Now, for externs... Say you have something like this in your header:extern int x;Then, in file1.cpp (which includes your header):int x = 0;Then, in file2.cpp (also includes the header):x = 46;x in file1.cpp is also now equal to 46. You see, when you use an extern variable, you're telling the compiler that you want to use that variable across all of your source files. If you use a regular global, however, you create a new variable in each of your source files.Anyway, that's just for variables, which I assume you're talking about - global and extern functions are a bit different, and I'm not entirely clear on them.
'global static'?! There is no such thing.
The "extern" declaration in C is to indicate the existence of, and the type of, a global variable or function. A global variable, or a global function, is one that is available to all C modules (a single C module is typically a single .c file). An extern is something that is defined externally to the current module. In many cases, you can leave off the extern qualifier and not notice any difference because the linker can collapse multiple definitions to one. But the intent is then unclear in the code, and the code is error prone in case of typos. It is much clearer to define the global in one place, and then declare extern references to it in all the other places. When refering to globals provided by a library, especially a shared library, this is even more important in order to ensure you are talking about the correct, common instance of the variable. Declaring a variable as extern will result in your program not reserving any memory for the variable in the scope that it was declared. For instance (as example) if a program's source code declared the variable var as a global volatile int in foo.c, to properly use it in bar.c you would declare it as extern volatile int var. It is also not uncommon to find function prototypes declared as extern. A good C manual will certainly answer this more completely.
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.
Default initial value of extern integral type variable is zero otherwise null.
the difference between global and international strategy
Might be, but don't forget the keyword 'extern':int main (void){extern int errno;...}
what is the difference between international communication and global communication
AnswerGlobal variables and extern variables are very similar, but with a major difference. Let's say you have a global variable in your header file, like this:( Refer how u can add the variable declaration in the source code as extern, i think we cant add into header files as it said)int x = 0;Now, in each file that includes that header file, there will be a new variable called x. Modifying x in file1.cpp won't modify x in file2.cpp.Now, for externs... Say you have something like this in your header:extern int x;Then, in file1.cpp (which includes your header):int x = 0;Then, in file2.cpp (also includes the header):x = 46;x in file1.cpp is also now equal to 46. You see, when you use an extern variable, you're telling the compiler that you want to use that variable across all of your source files. If you use a regular global, however, you create a new variable in each of your source files.Anyway, that's just for variables, which I assume you're talking about - global and extern functions are a bit different, and I'm not entirely clear on them.
essential diffrence between global and local optimization
There is no difference between the two. The global depletion of ozone is the hole over ozone only.
'global static'?! There is no such thing.
what is the difference between global politics and international politics
Perhaps an example will help. extern int value; /* declaration */ int value; /* definition */ int value= 20; /* definition with initialization */
there aren't any
the difference between technology and global awareness is that you use technology is that they both show information.
None