C++ -using file scope static function
<p>I expected that GetStudent() function returns unique instance of Student. As I expected, that function returns unique instance of Student Class. I double checked the memory address returned by GetStudent() function.  But very strange thing was that Student's constructor called every time when I called GetSutent() function. The code like below. The programming enviroment was VC6.0 &amp; MFC project.</p>

<pre><code>   //someApp.h
    Student&amp; GetStudent();


    //someApp.cpp
    Student&amp; GetStudent()
    {
       static Student _student;
       return _student;
    }


    //client1Class.cpp
    #include "someApp.h"
    void CCliend1Class::DoSomething()
    {
      GetStudent().DoSomething();
    }



    //client2Class.cpp
    #include "someApp.h"
    void CClient2Class::DoSomething()
    {
      GetStudent().DoSomething();
    }
</code></pre>
