Hi!
Does anyone know how I could initialize an array in a constructor in VisualC++? My code looks like this:
// MyHeader.h
class MyClass: public MyParent{
int m_array[3];
int m_other;
}
//MySource.cpp
MyClass::MyClass():
MyParent(this),
m_array[0](g_button_8),
m_array[1](g_button_9),
m_array[2](g_button_10),
m_other(150){
m_other.add_callback(on_scroll, this);
}
This code initialize m_other to 150, add a callback to m_other and SHOULD initialize m_array's three slots to with the globals variable g_button_X.
I really need to initialize my variables this way in the constructor.
This works perfectly for the simple variable (ex. integer) but it generate errors with arrays.
Anyone know how to initialize an array's "slots" one by one this way?
Thanks.
Illuna