將多個整形數字拼接形成一個新的整數

可以使用boost庫的強轉lexical_cast

UINT64 GetFinalTargetID(const UINT32& time, const UINT32& radarId, const UINT32&targetId)
{
	std::string str = boost::lexical_cast<std::string>(time) + boost::lexical_cast<std::string>(radarId) + boost::lexical_cast<std::string>(targetId);
	return boost::lexical_cast<UINT64>(str);
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章