Problem solved and in 3 ways! 1. The "Keep it Simple Stupid" Advice works! Instead of creating an array of MATERIAL i.e Material*, I simply created an array of Material, and accessed each Material by the . notation rather than the ->. i.e.
g_ptrMaterials = new Material [g_numberOfRows];
Material mat;
mat.temperature = 200.00; // for example
2. One can stuff the structures into a vector:
vector vctr;
Material mat;
mat.temperature = 200.00; // for example
mat.density = bla bla;
vctr.push_back(mat);
3. Lastly I modified the initial code. I don't know why it works ...
MATERIAL* arrMaterial = new MATERIAL[g_numberOfRows];
g_ptrMaterial = &arrMaterial[0];
arrMaterial[i] = new Material; //everything works fine now
Perhaps the problem was mixing the malloc and new allocators? I suspected the problem was with the memory allocation, when the compiler continuously indicated errors in xmemory, dbgheap, and what not. It wasn't a v e r y pleasant experience. Anyway, I went for the first option, but one can go for any of the 3 options I suppose, without any harm. Thanks guys :)