标签:oca xid x86_64 col stage root权限 处理器 abc out
yum install gcc-c++
#include <iostream> #include <thread> void hello() { std::cout<<"Hello Concurrent World\n"; } int main() { std::thread t(hello); t.join(); }
#include <iostream> #include <vector> #include <unistd.h> using namespace std; typedef unsigned char BYTE; int main() { vector<int> int_vec; int_vec.push_back(1); int_vec.push_back(2); int_vec.push_back(3); int_vec.push_back(4); for(auto v : int_vec) { cout << v << "----hello C++11. -std=c++11 "<< getpid() << endl; } BYTE bt1 = 0x81; BYTE bt2 = 0xEE; int itest1 = 0x01; int itest2 = 0xFF; int itest3 = bt1; int itest4 = bt2; cout << "itest1=" << itest1 << ", itest2=" << itest2 << ", itest3=" << itest3 << ", itest4=" << itest4 << endl; return 0; }
//////////// g++ chap1-1.cpp -std=c++11 -pthread -o abc.bin #include <iostream> #include <thread> #include <unistd.h> #include <vector> using namespace std; void MyThread(int iPara) { cout<<"MyThread----: "<< iPara <<endl; sleep(1); ///The para is Seconds } int main() { thread threadDemo(MyThread, 123); cout <<"-----------start"<<endl; threadDemo.join(); cout <<"-----------end"<<endl; vector<int> vecTest; vecTest.clear(); vecTest.push_back(10); vecTest.push_back(20); vecTest.push_back(30); vecTest.push_back(40); vecTest.push_back(50); vecTest.push_back(1); vecTest.push_back(2); for(auto &changeValue:vecTest) { changeValue = changeValue * 2; } //////////// // cout<<"display new value:"<<endl; for(auto newValue:vecTest) { cout << newValue<<endl; } return 0; }
CentOS 6.6 升级GCC G++ (当前最新版本为v6.1.0) (完整)
标签:oca xid x86_64 col stage root权限 处理器 abc out
原文地址:https://www.cnblogs.com/music-liang/p/11908455.html