Hey, I'm trying something to have a number change its value based on another number in an attempt to get a pattern going so im starting with one value constantly changing back and forth from one digit to another in real time so I tried doing this:
#include <iostream>
usingnamespace std;
int main (){
int r = 2;
int *s;
int t = 5;
int *u;
*s = r ;
*u = t;
if(r == *s){
r = t;
}else
{cout << " :( " << endl;
}
if (r = t){
r = *s;
}else{cout << ">:{" << endl;}
cout << r << endl;
return 0;
}
Im confused how It landed on R's original value, shouldn't it loop back and forth
#include <iostream>
usingnamespace std;
int main (){
int r = 2;
int *s;
int t = 5;
int *u;
*s = r ;
*u = t;
do{r = t;}while(r == *s);
do{r = *s;}while(r = t);
cout << r << endl;
return 0;
}
Thanks I'm trying to set a value to one digit thatll trigger an if statement thatll trigger the other so it would go into an endless pattern
And I r = t is a typo I caught afterwards.