I would like some clarification on the use of "static" for a none member
From what I have read, it seems that the static keyword limits the function to be callable from within the .cpp file it is defined in. But how is this different to when I don't have the static keyword: the function is literally only visible in the .cpp so how can it be callable from anywhere else? I mean, if we have...
...then clearly any file that includes the header can call GetInt(). So how can we possibly call GetInt() if we can't see its declaration via the header?
If I change the .cpp to have the static keyword, even though the function is "visible" via the header, I then get linker errors (unresolved external symbol "GetInt()") when I try and call it outside of the defining .cpp. I guess this is so the .cpp can use the functions without having to bother about the order in which they are definedin the .cpp, whilst still preventing them from being callable outside that same .cpp. Is this right?
Apart from this, the whole concept of static on a none member function hence seems totally redundant to me...