is there anything wrong with this code that could be screwing anything read in from a file? I have been reading a .md3 tutorial so I am pretty sure the number of instances i am allocating memory for is correct, i.e the number of tags is equal to the number of tags in the header multiplied by the number of frames. Assuming all of that is correct are there any errors?

I only provided the actual implementation for the reader, I chose not to include the data structures because if there are any errors they must be in this following implementation. If no one finds any errors in this I am completely stumped because this is exactly how the online tutorial was doing it.

Code:
#include "Main.h"
#include "Md3.h"
#include "cuf.h"

#define Header tMd3Header
#define Mesh tMd3MeshInfo
#define Tag tMd3Tag
#define Bone tMd3Bone
#define Triangle tMd3Triangle
#define Face tMd3Face
#define TexCoord tMd3TexCoord
#define Skin tMd3Skin

Header		pHeader;
Mesh		pMesh;
Tag			*pTag		= NULL;
Bone		*pBone		= NULL;

model m1;
char newline[] = "\n";

float scale = 64.0f;

int location = 0;
int NumMeshes;
int numvertices;
int numtriangles;

int main(void) {
cout.setf(ios::fixed);
setprecision(2);
char NewLine[] = "\n";
char *Buffer = NULL;
char *bufferPtr = NULL;

FILE *filePtr = NULL;

char FileName[256];

cout << "Enter the name of a file to read" << endl;

cin.getline(FileName, 256, '\n');

filePtr = fopen(FileName, "rb");
if(!filePtr) {
cout << "File doesn't exist" << endl;
return 0;
}

memset(&pHeader, 0, sizeof(Header));	//CREATE STORAGE SPACE FOR OUR HEADER
fread(&pHeader, sizeof(Header), 1, filePtr);

pBone = new Bone[pHeader.numFrames];	//ALLOCATE MEMORY FOR BONES, WE ONLY READ THIS IN TO KEEP EVERYTHING ON TRACK
fread(pBone, sizeof(Bone), pHeader.numFrames, filePtr);
delete[] pBone;	//WE JUST DELETE THIS RIGHT AWAY, NO USE KEEPING IT

pTag = new Tag[pHeader.numTags * pHeader.numFrames];	//ALLOCATE MEMORY FOR TAGS 
fread(pTag, sizeof(Tag), pHeader.numTags * pHeader.numFrames, filePtr);	//READ IN THE TAGS

long offset = ftell(filePtr);	//FIND OUT WHERE WE ARE IN THE FILE

for(int index = 0; index < pHeader.numMeshes; index++) {	

	fseek(filePtr, offset, SEEK_SET);	//GO THE MESH INFORMATION
	fread(&pMesh, sizeof(Mesh), 1, filePtr);	//READ IN THE MESH

	//CREATE OUR TEMPORARY VARIABLES 
Skin		*pSkin		= new Skin[pMesh.numSkins];
TexCoord	*pTexCoord	= new TexCoord[pMesh.numVertices];
Face		*pTriangle	= new Face[pMesh.numTriangles];
Triangle	*pVertices  = new Triangle[pMesh.numVertices * pMesh.numMeshFrames];

fread(pSkin, sizeof(Skin), pMesh.numSkins, filePtr);

fseek(filePtr, offset + pMesh.triStart, SEEK_SET);
fread(pTriangle, sizeof(Face), pMesh.numTriangles, filePtr);

fseek(filePtr, offset + pMesh.uvStart, SEEK_SET);
fread(pTexCoord, sizeof(TexCoord), pMesh.numVertices, filePtr);

fseek(filePtr, offset + pMesh.vertexStart, SEEK_SET);
fread(pVertices, sizeof(Triangle), pMesh.numVertices * pMesh.numMeshFrames, filePtr);

for(int index1 = 0; index1 < pMesh.numTriangles; index1++) {
	cout << pVertices[index1].vertex[0] / scale << endl;
	cout << pVertices[index1].vertex[1] / scale << endl;
	cout << pVertices[index1].vertex[2] / scale << endl;
	cout << endl;
}
	cout << "number of verts in this model " << pMesh.numVertices << endl;
	getch();

delete[] pSkin;
delete[] pTriangle;
delete[] pTexCoord;
delete[] pVertices;

offset += pMesh.meshSize;	//INCREASE THE OFFSET TO THE NEXT MESH IN THE FILE

}

fclose(filePtr);

cout << "You have exited the program" << endl;
cout << "Everything should have worked correctly" << endl;
getch();

return 0;
}