This positions the pointer 49 places in the memory further, but you want it to be 49 structures in the memory further. In other words, you must also use the size of the struct in your calculation.

Both table and pLastStu are STRUCT*. It looks correct to me.

First off, as Hammer said, make names an array of an appropriate size, something like 50. If you decide to keep your names declared as char* then you want to allocate some memory for it. Something like:

Code:

names = malloc (50);

Second, you have coded a loop that handles the subscripts of scores members. But what about table members ?? You have that part of the code in the calling function?

scanf arguments must be addresses. You must add an ampersand to all arguments eccept for names. names is already an address.

Using scanf is never the best solution. The format string must exactly coincide with the text format in the file. I would suggest loading line by line with fgets and then parsing the line with string functions.