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??????

28th May 2021, 5:01 PM
saurabh
saurabh - avatar
2 Respuestas