C/C++
棌棌棌棌棌厷
github求互粉 https://github.com/wilhantian
展开
-
cocos2d-x获取系统日期或时间
cocos2d-x 3.x后原本CCTime被弃用,所以,只能使用C库中的获取系统日期和时间struct timeval nowTimeval;gettimeofday(&nowTimeval, NULL);struct tm * tm;time_t time_sec ;time_sec = nowTimeval.tv_sec;tm = localtime(&time_sec原创 2015-06-18 15:29:45 · 751 阅读 · 0 评论 -
std::string字符串分割
废话不多说,直接上代码:std::vector split(std::string str, std::string pat){ std::vector bufStr; while (true) { int index = str.find(pat); std::string subStr = str.substr(0, index); if (!subStr.empty(原创 2015-06-18 10:09:53 · 2914 阅读 · 0 评论