This code swaps the values of two variables pointed to by pointers p and q.

First, the value pointed to by p is stored in a temporary variable called temp. Then, the value pointed to by p is updated to the value pointed to by q. Finally, the value pointed to by q is updated to the value stored in the temporary variable temp.

After this code executes, the values originally pointed to by p and q will have been swapped.

int temp = p; p = q; q = temp;

原文地址: https://www.cveoy.top/t/topic/bSn6 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录