Stuck trying to copy a variable eg. var1 = var2; After a call like this I think that var1 is changed anytime var2 is. I think I need to use pointers but when I tried this, I got the same problem.
if you have something like below, it should work for you.
int main()
{
int num1 = 3;
int num2 = 5;
num1 = num2; // num1 == 5 && num2 == 5
return 0;
}
the other thing is, what kind of variables are they? Are they ints? floats? depending on what type of variable you have can affect how you should be assigning the value of one to the other...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.