extern static
vijirin (7) | Aug 4, 2008 at 5:53am |
Hi all, Is it possible to use extern static. I have wrote a program where i used extern static. This was firing a compiler error. But the same i compiled in another compiler but it compiled successfully. Can anyone please tell whether it is right to use extern static? Is it possible to use static exter ?.... Thanks in advance | |
anilpanicker (102) | Aug 4, 2008 at 10:21am | ||||||||||
storage type 'extern' means the variable declared in another file. storage type 'static' means the value of the variable is static with respect to the scope of the variable. When the program reenter the scope you can retrieve the value. The scope can a function or a file or a class. For example if you define at the top of a fle
every time you enter that file you can retrieve i=9. It is like global now if you want to use these together, the you need declare seperately For example: In h1.h file you declare
Then in h2.h file you declare
aEx.cpp
main.cpp
|
'via Blog this'
No comments:
Post a Comment