0
problem with swaping the numbers in c++
int A{10}; int B{20}; int *num1{&A}; int *num2{&B}; int *temp{num1}; num1 = num2 ; num2 = temp; Here I have observed that *num1 and *num2 swapped but not A & B........ why??????
2 Answers
int A{10}; int B{20}; int *num1{&A}; int *num2{&B}; int *temp{num1}; num1 = num2 ; num2 = temp; Here I have observed that *num1 and *num2 swapped but not A & B........ why??????