如何转换
std::string strdate = "2012-06-25 05:32:06.963";
对于这样的事情
std::string strintdate = "20120625053206963" // 基本上我删除了 -、:、空格和 .
我想我应该使用 strtok 或字符串函数,但我做不到,任何人都可以在这里帮助我提供示例代码。
这样我就可以通过使用将其转换为无符号的 __int64
// crt_strtoui64.c
#include <stdio.h>
unsigned __int64 atoui64(const char *szUnsignedInt) {
return _strtoui64(szUnsignedInt, NULL, 10);
}
int main() {
unsigned __int64 u = atoui64("18446744073709551615");
printf( "u = %I64u\n", u );
}