2020年8月20日

没有中间变量的值交换

摘要: // Example program #include <iostream> #include <string> void swap(int & a, int & b) { a ^= b ^= a ^= b; } int main() { int a = 10; int b = 100; swap( 阅读全文

posted @ 2020-08-20 17:23 庭中核桃树 阅读(118) 评论(0) 推荐(0) 编辑

std::vector<bool> 的要点

摘要: #include <iostream> #include <vector> #include <memory.h> #include <stdio.h> int main() { int size_v = 10; std::vector<int> tmp(5, 0); int * tmp_pt = 阅读全文

posted @ 2020-08-20 09:03 庭中核桃树 阅读(474) 评论(0) 推荐(0) 编辑

导航