[英]How to convert decimal to hex in C++ JNI
Current convert decimal to hex in C#, i using code : 目前使用代码将十进制转换为C#中的十六进制:
private string Dec2Hex(int value)
{
return value.ToString("X2");
}
Please help port to C++ Jni. 请帮助移植到C ++ Jni。 Thanks
谢谢
so decimal to hex goes this way, if this helps you 所以十进制到十六进制是这样,如果这可以帮助您
std::stringstream ss;
ss<< std::hex << decimal_value;
std::string res ( ss.str() );
std::cout << res;
int value = Convert.ToInt32(/*"HexValue"*/);
String hexRepresentation = Convert.ToString(value, 16);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.