static Class doesn't show same values between other classes
<p>I hope that I am providing enough information and that I've titled this correctly.</p>

<p>In general, I want to have a class that stores data in my application, and I need several other classes to access the same data. essentially sharing the data between multiple classes. </p>

<p>Short/Concise Code follows:</p>

<p>example.cpp (main application)</p>

<pre><code>// example.cpp : Defines the entry point for the console application.
//
#include "AnotherClass.h"
#include "ObjectClass.h"
#include "stdafx.h"
#include &lt;iostream&gt;  
#include &lt;iomanip&gt;

using namespace std;  
//Prototype
static void do_example ( );

int main()  

{  
    do_example ( );
}

static void do_example ( ) {


    MyObject.a = 5;
    cout &lt;&lt;"MyObject.a value set in main application is "&lt;&lt;MyObject.a&lt;&lt;"\n";

    AnotherClass    m_AnotherClass;

    m_AnotherClass.PrintValue();

}       
</code></pre>

<p>ObjectClass.h</p>

<pre><code>class ObjectClass {
public:
    ObjectClass(); // Constructor
    int a; // Public variable
} static MyObject;
</code></pre>

<p>ObjecClass.cpp</p>

<pre><code>#include "ObjectClass.h"

ObjectClass::ObjectClass() {

    a = 0;

}
</code></pre>

<p>AnotherClass.h</p>

<pre><code>class AnotherClass {
public:
    AnotherClass(); // Constructor

    void PrintValue(); // Public function
    int value; // Public variable

};
</code></pre>

<p>AnotherClass.cpp</p>

<pre><code>#include "AnotherClass.h"
#include "ObjectClass.h"
#include "stdafx.h"
#include &lt;iostream&gt;  
#include &lt;iomanip&gt;

using namespace std; 

AnotherClass::AnotherClass() {

    value = MyObject.a;

}

void AnotherClass::PrintValue() {

    cout &lt;&lt;"value in AnotherClass is "&lt;&lt;value&lt;&lt;"\n";
    cout &lt;&lt;"it should be the same."&lt;&lt;"\n";
}
</code></pre>

<p>But the value is the default value of 0, as if it is a new instance of MyObject. But it should be pulling the value of 5 from the static MyObject.</p>

<p>What am I missing? </p>
