摘要: 1 #ifdef WIN32 2 time_t clock; 3 struct tm tm; 4 SYSTEMTIME wtm; 5 GetLocalTime(&wtm); 6 tm.tm_year = wtm.wYear - 1900; 7 tm.tm_mon = wtm.wMonth - 1; 阅读全文
posted @ 2020-05-20 13:19 洛洛沙 阅读(13708) 评论(0) 推荐(0)
摘要: 对于c++里面的容器, 我们可以使用iterator进行方便的遍历. 但是当我们通过iterator对vector/map等进行修改时, 我们就要小心了, 因为操作往往会导致iterator失效, 之后的行为都变得不可预知. 比如: 1 #include <iostream> 2 #include 阅读全文
posted @ 2020-05-20 10:00 洛洛沙 阅读(1665) 评论(0) 推荐(1)