Hi Ole,
How to bind 2 variables in C++ one with another so when one changes changes another?
You are looking for a concept called a reference, which is built on the concept called a pointer. The actual concept is that you want two Thingies pointing to a memory location.
for example I created Int A and Int B bound one to another and than when I change A one using some function another one will automatically change to new value of A.
You mean B will change to the new value of A, I take it.
int &B = A;
creates the reference B that points to the location A refers to.
Another approach - not the best approach for a beginner - is:
int *A = new int; //Get some heap memory for A to point to
int *B = A;
That uses pointers.
I am interested in version for C++ .net 4th version.
Strictly speaking, C++ is an ISO standard; .NET doesn't have anything to do with C++. However, Microsoft has the C++/CLI language which is sorta C++, but really isn't.