Error C2109 in an array

I'm having the error C2109 (subscript requires array or pointer type). My program is suppose to read and put in an array the file Inventaire.txt which shows information about the stock of a store with article numbers like this:

19370101 XS blanc 1937 16 152
19370102 S blanc 1937 11 51
19370103 M blanc 1937 6 175

But 125x. I don't understand why i'm getting the error C2109.

#include <string>
#include <iostream>
#include <fstream>
using namespace std;


int main()
{
int Nid;
int Nmod;
int Nmag;
int Nst;
string taille;
string couleur;
ifstream ficLu;
ficLu.open("Inventaire.txt");
if (ficLu.fail()) {
cout << "Probleme d'ouverture " << endl;
}
struct article
{
int Nid, Nmod, Nmag, Nst;
string taille, couleur;
};
article liste[125];
int a;
for (a = 0; a < 125; a++) {
ficLu >> Nid[a] >> taille[a] >> couleur[a] >> Nmod[a] >> Nmag[a] >> Nst[a];
}
cout << Nid[6] << taille[6] << couleur[6] << Nmod[6] << Nmag[6] << Nst[6];
}
Instead of Nid[a], I suppose you want liste[a].Nid.
Thank you Peter! it works now!
Topic archived. No new replies allowed.