error reading sequential file values to an array

I've been tasked with making a log in program but I keep getting an error whenever I try to read in a value to an array.
To be more specific I'm trying to read in a value to an array that looks like this

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
     int listSize;
     struct userData
     {
         string username;
         string password;
     };

     ifstream inFile;
     inFile.open("F:\\NamePassword.txt");
            
     inFile>>listSize;

     userData user[listSize];
     
          
     for(int count = 1; count < listSize; count++);
     {        
         inFile>>user[count].username;
         inFile>>user[count].password;
     }

    inFile.close();


for some reason though I get the following error from 'inFile>>user[count].username;':

"name lookup of `count' changed for new ISO `for' scoping"

If anyone can tell me what this error means and how I could possibly correct it I would be very grateful.
The 'number' that is read from "F:\\NamePassword.txt" is actually char(s). You'll have to convert to an integer to use that 'for' statement
Last edited on
Thanks! it works much better now
Topic archived. No new replies allowed.