Is this dynamic array procedure something that's not suitable for use with objects?
Dynamic arrays work with objects, the problem is the value of the static variable Fuzzy::n. Destructors are only called if the memory is freed, so if you create an array of 10 in the first iteration of the loop without freeing the array, then 2 in the second, Fuzzy::n never decreases to 0. The initialization will try to populate an array of 12 when there are really only 2 elements. The fix is of course to free the array.
int main () {
int i;
Fuzzy *ent;
while(1){
cout << "How many objects? ";
cin >> i;
ent = new (nothrow) Fuzzy[i];
if( ent == 0 )
cout << endl << "No memory!";
for( int n = 0; n < Fuzzy::n; n++){
for( int i = 0; i < 48; i++ )
ent[n].position[i] = 24;
ent[n].score = 567;
}
cout << ent[0].n << endl;
delete[] ent; // this line was added
}
}