c++ - static function definition in header -
in header xxx.h
:
static int yyy(); int yyy() { return 0; }
if include xxx.h cpp file, yyy() still static function?
yes, still static. every compilation unit (.cpp file) have own version of yyy
.
compiler not "see" header files. gone in pre-processing stage, each #include
replaced text of file contents of #include
, , compiler see 1 long stream of characters.
Comments
Post a Comment