title: Keep getting "member reference base type 'string [1000]' is not a structure or union" error and dont know how to fix it?
body: <p>This program reads an SSN from the user and checks if it matches an SSN in a text file provided. Tried switching the array to a vector and it didnt work. Tried putting the array in the structure function and using info:: but nothing seems to work. I know this is pretty basic but I cant get it, thanks.    </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  using namespace std;
  
  int main(int argc, char* argv[]){
  
    struct info{
      string SSN;
      string firstName;
      string lastName;
    };
  
    string list[1000];
    string userSSN;
    char x;
    fstream input(argv[1]);
    int i = 0;
    while(!input.eof()){
      input &gt;&gt; list.x[i] &gt;&gt; list.SSN[i] &gt;&gt; list.firstName[i] &gt;&gt; list.lastName[i];
      i++;
    }
    input.close();
  
    cout &lt;&lt; "Input a SSN:" &lt;&lt; endl;
    cin &gt;&gt; userSSN &gt;&gt; endl;
    for(int k = 0; k &lt; i; k++){
      if(userSSN.compare(list.SSN[k]) == 0){
        cout &lt;&lt; "Found at location " &lt;&lt; k &lt;&lt; endl;
      }
    }
  }
  </code></pre>