236 views
0 votes
0 votes
What is the differences between static and extern in C ? How it work ?

1 Answer

0 votes
0 votes
In static keyword you are creating a variable in data part of the OS which is accessible to the creating function which means it's scope is local whereas in extern keyword you are actually not creating the variable or simply say you are not reserving space in data part, but you are referring to previously present global variables in data part.

Related questions

2 votes
2 votes
1 answer
1
iarnav asked May 5, 2017
323 views
void main() { int *ptr; ..... ..... { int ch; ptr = &ch; } ..... // Here ptr is dangling pointer }Since here's no function calling and only main(). So, I am not able to u...
1 votes
1 votes
0 answers
2
Vishwanath Ravula asked Nov 23, 2016
145 views
What is difference between static scoping and dynamic scoping?
1 votes
1 votes
1 answer
4