vendredi 2 septembre 2016

Error lvalue required as left operand of assignment c++

The whole program basically just allows the user to move the cursor and if the user is in the given range of coordinates (2,2), the user is allowed to type the input. I have just provided some bits of the code which I thought would be enough for solving the problem.

I don't know what is causing this problem.Can you also explain why is it happening !!

void goToXY(int ,int);

Created a function with two ints.

int X = 0, Y = 0;

Initialised two ints.

if(X = 2 && Y = 2){
    cin >> input;
}

This is where the error is(it's above)

void goToXY(int x = 0, int y = 0) {

    COORD c;
    c.X = x;
    c.Y = y;
    SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), c);
}

Here's where I define the function(it's above)

Aucun commentaire:

Enregistrer un commentaire