
is static data shared between processes
Quote:
>My question is: if I have a static variable V = 0 in a class, and this
>class after a certain operation does V++, and
>then another process creates an instance of the same class, would the value
>of V be equal to 0 or 1?
Maksim,
Another process will have its own variable, so it will be 0.
If you want to share data you have to manage it specially using some
interprocess mechanism such as memory mapped files. Have a look at
Knowledge Base article Q100634 "HOWTO: Specify Shared and Nonshared
Data in a DLL" which documents using #pragma data_seg.
Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.