»
(18)C++14 智能指针及引用计数*
(19)C++14 多线程pthread*
(20)C++14 同步锁mutex*
(23)C++14 循环语句
(24)C++中的计时与等待*
(25)C++中的高精度计算*
(27)C++14 std::string*
(31)C++高级技能*
for-loop:
------------------------------------------------------------------
for(int i=0;i<100;i++){
std::cout<<i<<" ";
}
std::cout<<std::endl;
------------------------------------------------------------------
for-each-loop:
------------------------------------------------------------------
for(auto &item:vectorVal){
std::cout<<item<<std::endl;
}
for(auto& pair:mapVal){
std::cout<<pair.first<<" "<<pair.second<<std::endl;
}
------------------------------------------------------------------
while-loop
------------------------------------------------------------------
while(true){
std::cout<<"looping"<<std::endl;
if(needExitLoop){
break;
}
}
------------------------------------------------------------------
do-while-loop
------------------------------------------------------------------
int count=1;
do{
std::count<<"count::::"<<count<<endl;
--count;
}while(count>0);
------------------------------------------------------------------