将unsigned char *转换为uint64_t

我已使用以下内容将uint64_t转换为unsigned char *:
uint64_t in;
unsigned char *out;
sprintf(out,"%" PRIu64,in);

现在我想做相反的事情.任何的想法?

与sprintf(3)所做的直接类比是使用 sscanf(3)
unsigned char *in;
uint64_t out;
sscanf(in,"%" SCNu64,&out);

但是在错误处理方面,strtoull(3)可能会更容易和更好:

out = strtoull(in,NULL,0);

(这个答案假设真的指向某些东西,类似于如何指出示例代码中的内容.)

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...