I am trying to use the float& operator in C++. I have just started with the language so I wanted to know the difference between float and float& operator in C++. For example when I write,
float var1;
float& var2=var1;
cout<<&var1<<endl<<&var2;
Then the output is the same address for both the var1 and var2. But if this is so, then var1 and var2 are the same variables, i.e. I'm accusing the same chunk of memory using two different reference names. Then what exactly is the difference between var1 and var2? are they the same? And also to make a carbon copy of the variable do we use float&?