hey cud i know the difference between static & external variables??
hey cud i know the difference between static & external variables??
When you define a variable as extern you are just telling the compiler that the variable is defined in another object and that it won't find the variable's definition in this file. If you didn't do this the compiler would not know where the variable resides in your executable, and if you try to redefine it you will get linker errors because the same thing is created in two different spots.
A static variable can be thought of as a global variable with local scope.
Yes and no. You can have static variables defined in functions also. For that matter, you can even have static functions. This is stuff covered in any basic C book.
Quzah.
Hope is the first step on the road to disappointment.
...and about a *billion websites that can be found with google.
*: This is an understatement
Sent from my iPad®