Merge pull request #257 from ShenMian/ShenMian-patch-1

Update Swap in cpp.md
This commit is contained in:
Randy8080 authored and GitHub committed 2022-08-15 11:44:39 +08:00
commit 70362e2505
1 file changed
+2 -4
+2 -4
View File
@@ -87,10 +87,8 @@ std::cout << "You entered " << num;
### Swap
```cpp
int a = 5, b = 10, temp;
temp = a;
a = b;
b = temp;
int a = 5, b = 10;
std::swap(a, b);
// Outputs: a=10, b=5
std::cout << "a=" << a << ", b=" << b;