我有一种方法可以接受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 *?