dimanche 4 février 2018

C++ input/output error

#include<iostream>
using namespace std;

struct arr{
int n[100];
int array[99];
};


int main(){
int t,i=0,temp1[10],temp2[10],c1=0,c2=0;
arr A[100];
cin>>t;
cout<<endl;
if(t>=1 && t<=100)
{
    while(i<t)
    {
        cin>>A[i].n;
    if(A[i].n%2==0)
    {
        for(int j=0;j<A[i].n;j++)
        {
            cin>>A[i].array[j];
        }
    }
    else 
    {cout<<"\n Program Terminated";
    break;}
    cout<<endl;
    i++;
    }
}
else
cout<<"Program terminated";
return 0; } 

Blockquote

This is the code that i wrote but am getting error - [Error] no match for 'operator>>' (operand types are 'std::istream {aka std::basic_istream}' and 'int [100]') This is the first time i have encountered such error

Aucun commentaire:

Enregistrer un commentaire