class initialization problem
<p>Program works fine,but memory validator reports error UNINITIALIZED READ on line CProfiles profile; </p>

<p>Is that "profile" definition of class CProfiles outside CProfiles body a bad programming practice ?</p>

<p>Here is my code:
inside profiles.cpp</p>

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

CProfiles profile;  // Here it reports the problem
KeyProfile* keyProfile=&amp;profile;    // keyProfile is later used in other classes
//-------------------------------------------------------------

CProfiles::CProfiles():forceDialog(0)
{
      oldName="";
}

int CProfiles::Init()
{   
     _chdir(PROFILES_PATH);
}

CProfiles::~CProfiles()
{
}
</code></pre>

<p>inside profiles.h</p>

<pre><code>#define PROFILES_PATH           "Profiles"  
#include "KeyProfile.h"

class CProfiles: public KeyProfile
{

    public: 
       CProfiles();
       ~CProfiles();
       int Init();
       bool forceDialog;
       string oldName;
};

extern CProfiles profile; 
</code></pre>

<p>KeyProfile.h</p>

<pre><code>    public:
   virtual UINT GetKeyUp()      { return DIK_UP; }
   virtual UINT GetKeyDown()    { return DIK_DOWN; }
   virtual UINT GetKeyLeft()    { return DIK_LEFT; }
   virtual UINT GetKeyRight()   { return DIK_RIGHT; }
   virtual UINT GetKeyAction()  { return DIK_RETURN; }
   virtual UINT GetKeyCancel()  { return DIK_RCONTROL; }
       virtual UINT GetKeyEsc() { return DIK_ESCAPE; }
   KeyProfile(void){};
   virtual ~KeyProfile(void){};
    };
    extern KeyProfile* keyProfile;
</code></pre>
