0

Hey,
I'm working my first program that includes structures. For some reason though I have having errors with my getline.

inFile.getline( studentar, 20 );

My getline is being used in a function, so I don't know if that effects anything. The studentar array is declared as type student because that is what the structure I created is. Any suggestions would be great.

3
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by lancevo3
0

This is my structure.

struct student
{
int studentID;
double programAvg;
double testAvg;
};
0

Who told you to use cin.getline, didn't you knew cin.getline is only to fetch cstrings?

You should have used simple cin>> statement to read the data.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.