- 博客(43)
- 收藏
- 关注
原创 【C/C++时间系列】字符串通过strptime函数转换成struct tm
字符串可以通过strptime函数转换成分解的时间struct tm。关于struct tm的介绍可看 【C/C++时间系列】struct tm 通过strftime转换成字符串 。【strptime】strptime主要用于把字符串转换成分解时间,与strftime的作用相反。都位于time.h中,其原始模型如下/* Parse S according to FORMAT and ...
2018-07-28 00:48:40
7144
原创 【C/C++时间系列】struct tm 通过strftime转换成字符串
【分解的时间 struct tm】struct tm 是linux中用来保存分解时间的数据结构。其定义在time.h中,可通过下面命令找到$whereis time.h其结构定义如下,基本都是整型的。有几点需要注意的1、tm_sec 表示秒,除了0~59秒,可以取值60,主要是考虑leap second,即闰秒2、tm_mday 是从1开始的,表示一个月的天数,最大31...
2018-07-26 21:09:15
3771
原创 【C++】单引号与双引号的坑
C++中,经常忽略 单引号与双引号的区别。【KeyPoint】单引号是char类型,双引号是字符串类型如下例子 第10行#include <iostream>#include "ClassTemplate.h"using std::cout;using std::endl;int main(){ myClass<int,int> class1...
2018-07-18 14:12:10
4009
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅