65,211
社区成员
发帖
与我相关
我的任务
分享
#include <time.h>
#include <iostream>
using namespace std;
int main()
{
int seconds1 = 0;
int seconds2 = 0;
string time1 = "2002-01-01 05:35:41";
string time2 = "2002-01-01 05:36:33";
struct tm tm1;
strptime("2002-01-01 05:35:41","%Y-%m-%d%H:%M:%s", &tm1);
seconds1 = time( NULL );
cout << "seconds1 = " << seconds1 << endl;
return 0;
}
我经过编译,总是报
Compiling...
main.cpp
G:\Time1\main.cpp(16) : error C2065: 'strptime' : undeclared identifier
执行 cl.exe 时出错.
Time1.exe - 1 error(s), 0 warning(s)
这倒底是什么原因
#include <time.h>
#include <iostream>
using namespace std;
int main()
{
int seconds1 = 0;
int seconds2 = 0;
string time1 = "2002-01-01 05:35:41";
string time2 = "2002-01-01 05:36:33";
struct tm tm1;
strptime("2002-01-01 05:35:41","%Y-%m-%d%H:%M:%s", &tm1);
seconds1 = time( NULL );
cout << "seconds1 = " << seconds1 << endl;
return 0;
}
我经过编译,总是报
Compiling...
main.cpp
G:\Time1\main.cpp(16) : error C2065: 'strptime' : undeclared identifier
执行 cl.exe 时出错.
Time1.exe - 1 error(s), 0 warning(s)
这倒底是什么原因