My experience tells me that this object:
class Object
{
private:
static int array[];
public:
Object(int id);
};
int Object::array[] = { 2937, 892 };
Object::Object(int id)
{
}
Initialization arraywill occur before calling any method on Objector calling any method on any other object in the program, whether the object is declared staticor not.
Basically, I ask, who does not agree with the fact that the static simple types of C (not objects), such as char, short, intand long(and structure without the designers, made up of these types) are initialized when an executable file is loaded into memory before calling main () or any other constructor?
source
share