Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Static data - c...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 9769 of 9984
Post > Topic >>

Static data - can it go out of scope?

by Stodge <stodge@[EMAIL PROTECTED] > Jul 5, 2008 at 07:45 AM

I'm having an issue with Boost Python & C++. I have a C++ class Entity
ex****ted to Python that includes private static data, which is
basically an array of strings. My class contains a public static
function Dump(), which is also ex****ted to Python using Boost Python.
My application initialises the string array at startup and I've
verified in the debugger that this does happen.


The fun happens when I call the static function Dump from Python:

Entity.Dump()

The function executes ok, but the string array is empty. It's as
though the private static data has gone out of scope or been "lost". I
just read and learned that static data is maintained as a "global
variable". Can this happen in C++? Can static data go out of scope?

Thanks

--
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 3 Posts in Topic:
Static data - can it go out of scope?
Stodge <stodge@[EMAIL   2008-07-05 07:45:52 
Re: Static data - can it go out of scope?
Mathias Gaunard <loufo  2008-07-05 16:52:16 
Re: Static data - can it go out of scope?
Le Chaud Lapin <jaibud  2008-07-08 20:28:14 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 8:42:06 CDT 2008.