Ok, I found it. The problem is that your are assuming that the compiler will initialize your data for you. For example:
Code:
int n; //can't assume the value will be 0, or any other value for that matter
The same thing goes for struct's and class's:
Code:
struct foo
{
int n;
int *p;
};
...
foo f; //can't assume any value for f.n or f.p
So, you are getting a runtime error because FromList->head does not equal NULL when Add(FromList, ImportedTitle) is run. This easily fixed by adding constructors to your structs:
Code:
struct Movie
{
String Title;
String Renter;
Movie* Next;
Movie() : Next(NULL) {}
};
struct MovieList
{
Movie* Head;
int Size;
MovieList() : Head(NULL),Size(0) {}
};
As for using the debugger, its easier than you think. The debugger will basically allow you to inspect the values of your variables and stop/start execution. Put your cursor on "Add(FromList, ImportedTitle);" then select Build->Start Debug->Run To Cursor.
Type in 7 and movies.txt and you'll see that execution has stopped right where you told it. You can now inspect the values of your variables by selecting View->Debug Windows->Variables.
Click on the '+' next to 'FromList'. You will see that FromList->Head has a value of 0xcccccccc and not NULL.
The best way to learn the debugger is to play around with it.
gg