   (Direct X Mesh) File Parsing
  I want to load in mesh information into my C app from a direct x mesh files.My custom MODEL is as follows:typedef struct Vertex {float x, y, z;float u, v;float nx, ny, nz;} VERTEX;typedef struct FaceIndex {int nFacesIndices;int *nIndices;} FACE_INDEX;typedef struct Mesh {char name[512];char textureName[1024];int nVertices;int nTextureCoords;int nFaces;VERTEX *pVertexBuffer;FACE_INDEX *pFaceIndexBuffer;} MESH;typedef struct Model {MESH *pMesh;} MODEL;Basicallly, this says that I have a model file, which will contain sub meshes. It's fairly self explanatory.I parse the information from the x file into the custom model in c file separate from the main fucntion. I wont post the parsing code as it is a bit long winded. I know the information is being loaded correctly as I print information as it parses.In my main function I do the following:pModels = (MODEL*) calloc (MAX_MODELS, sizeof(MODEL));for (model = 0; model &lt; 7; model++) {pModels[model].pMesh = (MESH*) calloc (10, sizeof(MESH));}loadXModels(&pModels);This creates MAX_MODELS number of models and 7 submeshes for each model. pModels and pMesh are both global variables. After the load X models code I try to print the some information from the first (and only, at present) model to the console window. printf("faces = %d ", pModels[0].pMesh[0].nFaces);The program crashes on this piece of code. The debugger says that MESH name, nFaces etc are bad pointers.Not sure what hte problem is. Can someone hepl please?Thanks,Thomo   