+ 1

What is ment by swapping in c

4th Sep 2019, 4:56 AM
Akhil RĂąj
Akhil RĂąj - avatar
2 Answers
+ 6
It could be one of several things like interchanging the values of two variables. The term is also sometimes used when data is written by the OS from memory into disk.
4th Sep 2019, 6:22 AM
Sonic
Sonic - avatar
+ 5
I never heard of something special like swapping in C, but maybe you mean swapping of two values? Swapping values of a and b could look like this: int a = 10; int b = 20; int c; c = a; a = b; b = c; // a == 20, b == 10
4th Sep 2019, 6:25 AM
Aaron Eberhardt
Aaron Eberhardt - avatar