(Hopefully this won't show up twice; if it does, I apologize. I'm
reasonably sure Google dropped my first post though, so here goes
What is the difference between those two. Is there gonna
be some difference in app execution for static functions?
What difference does it make?
Victor answered your questions for member functions in classes. (If
not, consult Google or your C++ book; anything that talks about classes
should talk about this forn of static-ness.) However, there can be free
(non-member) functions that are static too, and static in this context
means something entirely different.
Normally you can use a function defined in another compilation unit by
using the extern keyword:
File1.cpp
int foo() { ... }
File2.cpp
extern int foo() { ... }
int main() { foo(); }
However, if you have functions that you don't want to be able have this
done to (sorta similar to the idea of private member functions), you
can make them static:
File1.cpp
static int foo() { .. }
Now a linker error will be generated because extern int foo() can't
pull it in.
This use has been superceded in C++ by the unnamed namespace. File1
(the second version) should be refactored as:
File1.cpp
namespace
{
int foo() { ... }
}