I'm getting a segmentation fault when I run this. It compiles fine, and it reads from the file fine, it even prints a 0 when it runs, so I know that it has something to do with my list array.
I need to figure out what is making this segmentation fault. Any help is appreciated.
It's crashing in makeMovie. There are actually two problems in there. The first is this:
name = new char[strlen(tempName)];
You need to add 1 to the number of characters you allocate because strlen doesn't count the terminating null character. That'll cause problems, but that isn't what's causing your segfault in this case.
The main problem is this:
strcpy(aMovie->name, name);
Since aMovie->name was never initialized, you can't copy a string there. You probably wanted to just copy the pointer:
Thanks. I thought I found out specifically where it seg faults:
In makeMovie:
Code: Movie* aMovie = new Movie;
It runs makeMovie fine the first time through the loop, and then the second time through it seg faults when it attempts to create space on the heap for the new Movie.