Register    Login    Forum    Search    FAQ

Board index » Everything




Post new topic Reply to topic  [ 11 posts ]  Go to page Previous  1, 2
Author Message
 Post Posted: November 1st, 2017, 9:39 pm 
 

Joined: February 28th, 2013, 3:23 am
Posts: 2962
Location: Oklahoma, United States
static has a few meanings though, all stored in static memory, but in a function it's scope is still in the function. In class it's basically global, but can be hidden as a private member. In header, it is global, not sure why they say static is file scope when it can be seen and accessed by any translation unit that includes that header. Only way to get file scope is a global atop the cpp file.

I guess it also kind of depends on what you mean by scope. Where it can be accessed? Having to use the scope resolution operator (::) or when a destructor is called? If it's the last one, then namespace, file and static are all global since memory won't be freed and destructors won't be called until the program ends.

_________________
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com


Top 
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 11 posts ]  Go to page Previous  1, 2

Board index » Everything


 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron