current position:Home>C language will not be painful, seek solutions

C language will not be painful, seek solutions

2022-02-02 11:56:58 CSDN Q & A

img


Fifth question , Why is there no exchange between local variables when executing , Didn't you call the function ? Ask for an answer




Refer to the answer 1:

because main There is... In the function x and y, The proximity principle uses here x,y, and swap() What changes is the value of the global variable




Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202021156567942.html