#define Nal 41
#define maxcar 61
#define opmax 51
typedef char nombre[maxcar];
typedef char sistema_operativo[opmax];
typedef struct
{
nombre usuario;
sistema_operativo opera;
float memoria;
bool usara_app;
}TFG;
typedef TFG FP[Nal];
void introducir_inform(TFG FP, float &memoria, int &numuser)
{
numuser=0;
char respapp, resp;
cout<<"Desea introducir algun usuario s/n: ";
cin >> resp;
while(resp=='s' && numuser<Nal)
{
cout<<"Introduzca nombre y apellidos sin espacios blancos: ";
cin >> FP[numuser].usuario;
cout<<"Introduzca sistema operativo sin espacios blancos: ";
cin >> FP.opera;
cout<<"Introduzca memoria disponible: ";
cin >> FP.memoria;
cout<<"Esta dispuesto a usar la app S/N ";
cin >> respapp;
switch(respapp)
{
case 'S':
FP.usara_app=true;
break;
case 'N':
FP.usara_app=false;
break;
}
numuser++;
}
}
Porque aparece:
error: no match for 'operator[]' in 'FP[numuser]'
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa