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

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -