Hello and thank you to any who will answer me. I tried googling before but I'm afraid I'm using the wrong keywords. My problem is I cannot understand the meaning of the static declaration in front of a function. I'm not meaning a member function, but rather a function present in the main cpp file. For example:
what is the difference between declaring such a function as static instead to not to? I know how it works with member functions, but this is not a member of any class, is a simple function.
Hope someone will enlight me,
Bye
A static function inside a class is a function that can be called without an instance of the class.
A static function at file/namespace scope (ie, not within a class) within a .cpp file is a function whose symbol is not exported in the .o; that is, the function is not visible outside that .cpp file.
I assume the example in the original post is the latter case.