I'm trying to write a code so that I can get used to it and not have so much trouble, but that's not working out so well. I'm just look ing at line 31 (I know there are more problems, but I want to go real slow so that I can try to remember)
it keeps saying "error: lvalue required as left operand of assignment" and all I understand of that is error, so I was hoping I could get some help.
Pretty much everywhere that you have variable = something in a statement (such as your if statements), it should be ==. The test for equality is ==, whereas = is the assignment operator.
Also if you want to add things, for example to a variable, you'd do it like: x = x + 2 or x += 2. It would help you a lot if you looked over C++ operators again, since that seems to be your main issue right now. The ideas you have seem good enough, you're just using the wrong operators.
#include <iostream>
usingnamespace std;
int patter(){
int x = 0;
int y = 0;
y + 1;
x + 1;
while (1){
if (y==5 || y<=5){
y = y+1;
}
else{
y = y-5;
x =
x+1;
}
if (x==5 && y==5)
return 0;
cout << y << endl;
cout << x << endl;
system ("PAUSE");
system ("CLS");
}
}
int main()
{
patter();
return 0;
}