Hi,

I have a question - the following pieces of code keep generating a debug error (in VC++)

file1.hpp
-----------
struct A
{
CString m_name;
enum_type m_value;
};
// end file1.hpp

file1.cpp
-----------
#include "file1.hpp"
...
static A aArray [ 100 ];
...
bool someFunction ( int pos, CString name, enum_type value )
{
aArray[pos].m_name = name // <-- causes the assertion error
aArray[pos].m_value = value
}
...
void main()
{
someFunction(0,"lalala",ENUM_VALUE);
}
// end file1.cpp

A watch on the 'aArray' indicates that the CString members can't be viewed, presumably because the CString has not been initialized. About the assertion error, it comes during a GetData call, where it finds that the m_pchData variable is null.

Do I need to override the copy constructor for the struct?
Do I need to perform some initialization?
Have I written absolutely horrible code?

Sorry for the newbie question - any help would be greated appreciated!

-cb