Asked by rwniceing
at 2024-08-27 00:08:57
Point:500 Replies:13 POST_ID:829196USER_ID:12079
Topic:
C++ Programming Language;;C Programming Language
When we read the tutorial for pointer in C++ on internet articles, most likey, swap example will be used,
for example,
for example,
Probably it use swap the pointer to address's vaue to achieve the swapping.In other words, swap thier value. I want to know could we do it in other way, swap the pointer to address instead of its value ?
For example , before swap
&"x //address of x =FFAA00 and its value=42
&"y /address of y =BBCC00a and its value=17
after swap
&"x //address of x =BBCC00 and its new value=17
&"y /address of y =FFAA00 and its new value=42
Or I need to think about to do that using pointer of pointer
Please advise
Rwniceing