No, 1st of all, it's just an illusion that you don't use temporary. When u do a ^= b, the XOR of 2 variables is indeed stored in Accumulator (which is a temporary). So, this operation will be slower...
Type: Posts; User: iammilind; Keyword(s):
No, 1st of all, it's just an illusion that you don't use temporary. When u do a ^= b, the XOR of 2 variables is indeed stored in Accumulator (which is a temporary). So, this operation will be slower...
Well, Swetha's method is proper, but only meant for integers.
Following is the swap function for any type like: int, char, structure, pointers etc. anything.
template<class T>
void swap(T...
Ouput is :
f is NOT 1.0n
This is because floating point numbers doesn't have accuracy in certain cases (unlike 'double'). The interpretation inside the machine will be different than what we...