You failed to say what the problem is, but if you want to read one column at a time then using the extraction operator like that won't work right with csv files because columna may, or may not, be separated by white space (spaces and/or tabs). The csv files I've worked with had a comma between each column. So you would probably want to use the getline() function so that you can specify the character that terminates a word.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
If you want to read the file like that you will have to write an overloaded extraction operator for your structure because the standard stream classes don't know how to read structures. Or if you don't want to do that, then extract each element individually, something like this: I don't know what the structure looks like so I'll just make up something.
infile >> students[i].name >> students[i].address;
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343