我有一种方法可以接受const char *
,如下所示 -
bool get_data(const char* userid) const;
现在下面是我的 for 循环,我需要get_data
通过传递来调用方法const char *
。目前下面 for 循环使用uint64_t
. 我需要将其转换uint64_t
为const char *
然后传递给get_data
方法。
for (TmpIdSet::iterator it = userids.begin(); it != userids.end(); ++it) {
// .. some code
// convert it to const char *
mpl_files.get_data(*it)
}
这里TmpIdSet
是typedef std::set<uint64_t> TmpIdSet;
所以我的问题是我应该如何将uint64_t
上面的代码转换为const char *
?