Code:
StudentRecord**Temp; /*Declare array of pointers to a struct*/
Temp=new StudentRecord*[1000]; /*dynamically allocate memory*/
at this point in your code you've allocated an array of pointers. Temp[0] is a pointer, but it's not pointing to anything yet so this line
Code:
Temp[0]->firstName=new char[1000];
crashes because you are trying to access uninitialised memory.
you need to do this first.
Code:
StudentRecord**Temp; /*Declare array of pointers to a struct*/
Temp=new StudentRecord*[1000]; /*dynamically allocate memory*/
Temp[0] = new StudentRecord; // allocate space for student record
Temp[0]->firstName=new char[1000]; // should work fine now
I'm not sure why you're using an array of pointers anyway. A vector would be easier and safer or if you really need a container of pointers use a boost::ptr_vector (see my sig)