»
(18) C++14 smart pointer and reference counter*
(19) C++14 pthread*
(20) C++14 synchronized locker--mutex*
(23) C++14 for and while, do...while
(24) C++ time and sleep*
(25) C++ High Precision Computation*
(27) C++14 std::string*
(31) Advanced Level C++ Tech*
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);
------------------------------------------------------------------