mardi 4 décembre 2018

No output during array matching

I am trying to check two arrays if they are equal are not, if they are not equal print the corresponding text. I did this but i don't get any output or errors from this code. what did i do wrong in this?

typedef struct payl{
  int arrayp[5] = {1,2,3,4,5};  
}payl;
typedef struct expected{
  int arraye[5] = {1,2,3,4,6};
}expected;

int main()
{
    payl* pay;
    expected* Ez;
    int itr = (sizeof(pay->arrayp)/sizeof(pay->arrayp[0]));
    int eitr = (sizeof(Ez->arraye)/sizeof(Ez->arraye[0]));
    for(int i=0; i>itr; i++){
       for(int j=0; j>eitr; j++){ 
        if(pay->arrayp[i] != Ez->arraye[j]){
        cout<<"incorret matching"<<pay->arrayp[i]<<"!="<<Ez->arraye[j]<<endl;
        }
    }
}
    return 0;
}

I know they are other ways to do this, but i want to know what i did wrong in this. Thank you.

Aucun commentaire:

Enregistrer un commentaire