look at the structure -- credit is an array of floats and you are attempting to use it as if it were a single float object. Change the structure to remove the arrays
struct cgrade
{
char course[50]; // room for 50 character course name
float credit;
float grade;
};
>>gets(GPA[i].course);
never, ever use gets() function because it can cause your program to crash if you enter more characters than the input buffer can hold. Use fgets() instead
fgets(GPA[i].course, sizeof(GPA[i].course), stdin);
Last edited by Ancient Dragon; Sep 1st, 2006 at 9:02 am.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Offline 21,952 posts
since Aug 2005