c++ - Does compiler include global variables without static modifier in the global symbol table? -
i've read in (effective objective-c 2.0) static
variables declared in implementation file (m.file) local translation unit in defined , these variables not exposed in global symbol table. if global varible in .m-file declared without static
acts static
. static
used implicitly in such case or these different matters?
example:
//in m.file static int staticvariable;//100% static int globalvariable;//is static ? @implementation someclass { //local ivars declaration }
placing variables compiler dependent.
the compiler allowed place file static variables global variable segment, long scoping rules adhered to. actually, compiler can place variables anywhere in read-write memory, again long "as-if" rule adhered to.
when defining variables @ file scope, difference between using static
, not, static
hides variable other translation units. otherwise treated same.
note: applies c++ since op has c++ tag. don't know if applies objective c since language.
Comments
Post a Comment