3C科技 娛樂遊戲 美食旅遊 時尚美妝 親子育兒 生活休閒 金融理財 健康運動 寰宇綜合

Zi 字媒體

2017-07-25T20:27:27+00:00
加入好友
純C++建立多層目錄函數   資料來源: http://codex.wiki/post/144728-632   void CMyCab::CheckTargetPath(string targetPath) {     //Log &log = Log::getLog(“main”, “CheckTargetPath”);       int e_pos = targetPath.length();       int f_pos = targetPath.find(“\\”,0);       string subdir;       do     {         e_pos = targetPath.find(“\\”,f_pos+2);           if(e_pos != -1)         {               subdir = targetPath.substr(0,e_pos);               if(_mkdir(subdir.c_str())==0)             {                 printf( “creat success %s”,subdir.c_str());             }             else             {                 printf(“creat fail %s”,subdir.c_str());             }         }           f_pos = e_pos;     }while(f_pos!=-1); }     ​

本文由jashliaoeuwordpress提供 原文連結

寫了 5860316篇文章,獲得 23313次喜歡
精彩推薦