Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/266.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# base2中数字的字符串表示形式到C中64位有符号整数的转换_C#_C_Hex - Fatal编程技术网

C# base2中数字的字符串表示形式到C中64位有符号整数的转换

C# base2中数字的字符串表示形式到C中64位有符号整数的转换,c#,c,hex,C#,C,Hex,在C代码中,我有一行代码如下 string DE1Hex = String.Format("{0:X1}", Convert.ToInt64(newDE1, 2)); 我试图在我的项目中用C(而不是C++)实现 尝试 -->第二个论点 char *pEnd; long long ll_i1; ll_i1 = strtoll (newDE1, &pEnd, 2); -->第一个参数我不确定这是什么“{0:X1}” C#对我来说是新事物。我在C方面是公平的 请指导我进行此转换。我不明白您

在C代码中,我有一行代码如下

string DE1Hex = String.Format("{0:X1}", Convert.ToInt64(newDE1, 2));
我试图在我的项目中用C(而不是C++)实现

尝试 -->第二个论点

char *pEnd;
long long ll_i1;
ll_i1 = strtoll (newDE1, &pEnd, 2);
-->第一个参数我不确定这是什么“{0:X1}”

C#对我来说是新事物。我在C方面是公平的
请指导我进行此转换。

我不明白您想告诉我们什么:“尝试-->第二个参数”请,什么有效,什么无效?在本手册页底部有一个关于如何使用
strtoll()
的很好的示例:String.Format(1st,2nd)。不需要十六进制标记。我想知道strtoll相当于Convert.ToInt64,因为从标准中我看到这两个返回都很长long@user2357643,是的,strtoll()是正确的函数。