Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

BraveZeus

Question about static

This topic is 6803 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, I know how to use static member data and static member functions and static variables within a global (non-member) function, but I don''t see what you use a static global function for....could someone please explain this, I looked in MSDN docs (though not for very long I admit) and found nothing but info for static member functions, thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
I think it means the function is only available in the file it is declared and cannot be extern..

Share this post


Link to post
Share on other sites
Yep, static was one way in C to keep code modular (ie. make a function only visible to that particular file). Generally, if you''re using C++, which it seems like you are, you won''t need to create any of these yourself.

Share this post


Link to post
Share on other sites
It''s still useful in C++ to declare static global functions and data that won''t be used outside the module. It cuts down on exported symbols in the object file generated.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!