samedi 25 mars 2017

c++ : confused as to why the compiler is giving error not declared in this scope

This skeleton example part of my code is causing the error 'x' not declared in this scope. I would have thought the computer would do both the Krow > 2 and Krow == 3 statements.

void GaussianElimination::JacobianFiller(){

    if(Krow > 2){
        double x = Y(0);
    }
    if(Krow == 0){
     //............. stuff
    }
    else if(Krow == 3){
        double a = x
    }
}

Aucun commentaire:

Enregistrer un commentaire